On Sun, 25 Dec 2005 23:17:04 -0500, Alan Stern wrote:

> On Mon, 26 Dec 2005 [EMAIL PROTECTED] wrote:
> 
>> Hi all,
>> I am new to power management in Linux. I was wondering what if I want to
>> suspend a particular USB device without suspending the system as a whole
>> and after sometime resume it? Is that possible in Linux? If possible
>> then can anyone suggest me how to do that? Thanks in advance. I am
>> looking forward to your suggestions.
> 
> It is possible in modern Linux versions.  To suspend a device, you can do:
> 
>       echo -n 3 >/sys/bus/usb/devices/[device-name]/power/state
> 
> Any other sysfs path that ends up in the same location would obviously
> work just as well.  Perhaps 2 instead of 3 would be slightly better, but I
> think either one will be okay.  Note that before you can do this, you may
> have to suspend all the device's interfaces.  And if the device you want
> to suspend is a hub, you have to suspend all the hub's child devices
> first.
> 
> So for example, I have a USB flash disk attached at 1-1 (i.e., bus 1, port
> 1).  It has a single interface, named 1-1:1.0.  To suspend it, I can do:
> 
>       echo -n 3 >/sys/bus/usb/devices/1-1:1.0/power/state echo -n 3
>       >/sys/bus/usb/devices/1-1/power/state
> 
> To resume, use 0 instead of 3.  And of course, resume the device before
> resuming its interfaces:
> 
>       echo -n 0 >/sys/bus/usb/devices/1-1/power/state echo -n 0
>       >/sys/bus/usb/devices/1-1:1.0/power/state
> 
> You can see the current power state by cat'ing the .../power/state file.

Hi Alan,

I have a FC4 with kernel 2.6.14-1.1653_FC4, and I wanted to test suspend
and even power off a USB device.

I plugged a USB flash disk at 3-1 and tried to suspend it: 
cd /sys/bus/usb/devices
echo -n 3 > 3-1/3-1\:1.0/power/state ; echo -n 3 > 3-1/power/state  ; echo
-n 3 > usb3/power/state

While all "state" files changed value to "3", tested with "cat state" in
each case, the LED on the usb flash disk is still ON, and I can
mount/access it without echoing "0" in the state file.
Actually, I don't think that the device is suspended at all.
Am I doing something wrong ?

Thx,
Paul





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to