public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Hans de Goede <j.w.r.degoede@hhs.nl>
Subject: USB autosuspend and turning of usb pendrive leds
Date: Fri, 21 Sep 2007 15:28:36 +0200	[thread overview]
Message-ID: <46F3C704.5000203@hhs.nl> (raw)

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


             reply	other threads:[~2007-09-21 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21 13:28 Hans de Goede [this message]
2007-09-21 14:18 ` USB autosuspend and turning of usb pendrive leds Jiri Kosina
2007-09-21 14:20   ` Hans de Goede
2007-09-21 15:15     ` Jiri Kosina
2007-09-24 10:36       ` Oliver Neukum
2007-09-24 11:38         ` Hans de Goede
2007-09-24 13:25           ` Oliver Neukum
2007-09-21 19:47     ` [linux-usb-devel] " Oliver Neukum
2007-09-21 14:39   ` Alan Stern
2007-09-22 14:00     ` Hans de Goede
2007-09-22 14:29       ` Alan Stern
2007-09-22 17:08         ` Hans de Goede
2007-09-22 20:12           ` Alan Stern
2007-09-28 20:48 ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F3C704.5000203@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox