Re: [PATCH 9/9 v3] usbcore: add sysfs support to xHCI usb2 hardware LPM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-09-06 at 08:27 -0700, Greg KH wrote:
> On Tue, Sep 06, 2011 at 03:51:47PM +0800, Andiry Xu wrote:
> > This patch adds sysfs support to xHCI usb2 hardware LPM, so user can enable
> > and disable usb2 hardware LPM manually.
> > 
> > Signed-off-by: Andiry Xu <andiry.xu@xxxxxxx>
> > ---
> >  Documentation/usb/power-management.txt |   29 ++++++++++++++++
> >  drivers/usb/core/sysfs.c               |   56 ++++++++++++++++++++++++++++++++
> >  2 files changed, 85 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
> > index c9ffa9c..9e5d9dd 100644
> > --- a/Documentation/usb/power-management.txt
> > +++ b/Documentation/usb/power-management.txt
> > @@ -487,3 +487,32 @@ succeed, it may still remain active and thus cause the system to
> >  resume as soon as the system suspend is complete.  Or the remote
> >  wakeup may fail and get lost.  Which outcome occurs depends on timing
> >  and on the hardware and firmware design.
> > +
> > +
> > +	xHCI hardware link PM
> > +	---------------------
> > +
> > +xHCI host controller provides hardware link power management to usb2.0
> > +(xHCI 1.0 feature) and usb3.0 devices which support link PM. By
> > +enabling hardware LPM, the host can automatically put the device into
> > +lower power state(L1 for usb2.0 devices, or U1/U2 for usb3.0 devices),
> > +which state device can enter and resume very quickly.
> > +
> > +The user interface for controlling USB2 hardware LPM is located in the
> > +power/ subdirectory of each USB device's sysfs directory, that is, in
> > +/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The
> > +relevant attribute files is usb2_hardware_lpm.
> > +
> > +	power/usb2_hardware_lpm
> 
> This also needs to go into Documentation/ABI/ right?
> 

Yes, I assume it should be added to Testing directory.

> > +		When a USB2 device which support LPM is plugged to a
> > +		xHCI host root hub which support software LPM, the
> > +		host will run a software LPM test for it; if the device
> > +		enters L1 state and resume successfully and the host
> > +		supports USB2 hardware LPM, it will enable hardware LPM
> > +		for the device and the file shows "enable", otherwise
> > +		it shows "disable". You can write those words to the
> > +		file to enable/disable USB2 hardware LPM manually only
> > +		if the device can perform LPM and the host supports
> > +		hardware LPM. When driver suspend the port into U3
> > +		state, it will disable hardware LPM first.
> 
> This file should only show up if the device supports this, not for all
> devices like this patch has.
> 

Okay, will do that.

> And why would you not enable this for a device that supports this?
> 

The current test result of software LPM is not very optimistic: many
devices claim to support LPM but fail to do so, and although the device
I have passed LPM test work properly on the host with hardware LPM
enabled, I'm not sure how other devices and hosts will behave. Add a
switch in sysfs help debugging in some cases.

Thanks,
Andiry 


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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux