USB autosuspend and turning of usb pendrive leds



Hi All,

Please keep me CC-ed as I'm not subscribed.

Some time ago a mail about turning of the leds on usb pendrives once unmounted by hal was send to the fedora-devel list:
https://www.redhat.com/archives/fedora-devel-list/2007-August/msg01807.html

This mail talked about echo 2 > power/state for usb devices.

I tested the method described in the mail to turn of the drive light and it worked well.

As I think that turning of the drive led (as windows does) would be good visual feedback to the end user that its safe to remove the device I've written a patch for hal which does the power state change automatically when the last partition of a usb massstorage device gets unmounted.

However when testing the patch I found out that my now newer kernel no longer has power/state for usb devices, it only has power/level. I can send suspend to power/level, but then remounting the device won't work and me syslog fills itself with:
sd 2:0:0:0: [sdc] READ CAPACITY failed
sd 2:0:0:0: [sdc] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_OK
sd 2:0:0:0: [sdc] Sense not available.
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 00 00 00
sd 2:0:0:0: [sdc] Assuming drive cache: write through

Because hal keeps polling the device.

So this leads me to a couple of questions:
1) Would it be possible to funtionality to the kernel to suspend a device in
such a way that it will automatically unsuspend when used again?
2) Would it be possible to still make the polls succeed then with out
unsuspending the device (or atleast without doing something that would make
the led light again, what makes the led light exactly is unknown), or should
hal stop polling then?

Note I'm aware that some usb devices may not like being suspended, but thats a problem for later, if this cannot be made to work with devices which do handle suspend properly, then thinking about white and/or blacklisting it irrelevant.

Regards,

Hans

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: USB autosuspend and turning of usb pendrive leds
    ... Some time ago a mail about turning of the leds on usb pendrives once unmounted by hal was send to the fedora-devel list: ... This mail talked about echo 2> power/state for usb devices. ... As I think that turning of the drive led would be good visual feedback to the end user that its safe to remove the device I've written a patch for hal which does the power state change automatically when the last partition of a usb massstorage device gets unmounted. ... However when testing the patch I found out that my now newer kernel no longer has power/state for usb devices, ...
    (Linux-Kernel)
  • Re: Dell E310 JC474 motherboard USB issue
    ... your lights are across the front near the usb connectors. ... and boot again and report what happens. ... i dont think talking to a dell tech is worth it at this point. ... four LEDs. ...
    (alt.sys.pc-clone.dell)
  • [Possible BUG] Logitech USB keyboard inconsistent led state
    ... I'm using a logitech USB keyboard, I think it's one of the most cheap ... several times and is on as boot finishes. ... of the 3 leds on the keyboards: ...
    (Linux-Kernel)
  • Re: USB 2.0 =?ISO-8859-1?Q?Ger=E4te_werden_als_unbekanntes_Ger=E4?= =?ISO-8859-1?Q?t
    ... Trotzdem erkannte Windows meine 2.0 USB Geräte nicht mehr. ... > Rechner gibt bei denen das passiert. ... manchmal leuchten schon bei Booten die grünen LEDs am Hub, ... Next by Date: ...
    (microsoft.public.de.german.windowsxp.hardware)
  • Re: 8051 to DVI interface?
    ... I will place many white LEDs in a matrix, ... I will use a $50 ucPROS.com ATMEL USB ... I will rewrite the USB s/w to send full ... i know how easy high ...
    (comp.arch.embedded)