Skip to content

Commit 8afa408

Browse files
author
Sarah Sharp
committed
USB: Allow drivers to disable hub-initiated LPM.
USB 3.0 Link Power Management (LPM) is designed to allow individual links in the bus to go into lower power states. There are two ways a link can enter a lower power state: 1. Device-initiated LPM. When a USB device decides it can go into a lower power link state, it sends a message to the parent hub, telling it to go into either U1 or U2. Device-initiated LPM is good for devices that send data to the host, like communications devices. 2. Hub-initiated LPM. After the link has been idle for a specific amount of time, the parent hub will request that the child go into a lower power state. The child can refuse that request. For example, a USB modem may want to refuse the LPM request if it is in the middle of receiving a text message. Hub-initiated LPM is good for devices where only the host initiates the data transfer, like USB printers or USB mass storage devices. Links will be automatically placed into higher power states by the USB hubs and roothubs whenever the host starts a USB transmission. Introduce a new usb_driver flag, disable_hub_initiated_lpm, that allows drivers to disable hub-initiated LPM. Signed-off-by: Sarah Sharp <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Johan Hedberg <[email protected]> Cc: Hansjoerg Lipp <[email protected]> Cc: Tilman Schmidt <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Jan Dumon <[email protected]> Cc: Petko Manolov <[email protected]> Cc: Steve Glendinning <[email protected]> Cc: "John W. Linville" <[email protected]> Cc: Kalle Valo <[email protected]> Cc: "Luis R. Rodriguez" <[email protected]> Cc: Jouni Malinen <[email protected]> Cc: Vasanthakumar Thiagarajan <[email protected]> Cc: Senthil Balasubramanian <[email protected]> Cc: Christian Lamparter <[email protected]> Cc: Brett Rudley <[email protected]> Cc: Roland Vossen <[email protected]> Cc: Arend van Spriel <[email protected]> Cc: "Franky (Zhenhui) Lin" <[email protected]> Cc: Kan Yan <[email protected]> Cc: Dan Williams <[email protected]> Cc: Jussi Kivilinna <[email protected]> Cc: Ivo van Doorn <[email protected]> Cc: Gertjan van Wingerde <[email protected]> Cc: Helmut Schaa <[email protected]> Cc: Herton Ronaldo Krzesinski <[email protected]> Cc: Hin-Tak Leung <[email protected]> Cc: Larry Finger <[email protected]> Cc: Chaoming Li <[email protected]> Cc: Daniel Drake <[email protected]> Cc: Ulrich Kunitz <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent 51e0a01 commit 8afa408

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/usb.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,9 @@ struct usbdrv_wrap {
879879
* for interfaces bound to this driver.
880880
* @soft_unbind: if set to 1, the USB core will not kill URBs and disable
881881
* endpoints before calling the driver's disconnect method.
882+
* @disable_hub_initiated_lpm: if set to 0, the USB core will not allow hubs
883+
* to initiate lower power link state transitions when an idle timeout
884+
* occurs. Device-initiated USB 3.0 link PM will still be allowed.
882885
*
883886
* USB interface drivers must provide a name, probe() and disconnect()
884887
* methods, and an id_table. Other driver fields are optional.
@@ -919,6 +922,7 @@ struct usb_driver {
919922
struct usbdrv_wrap drvwrap;
920923
unsigned int no_dynamic_id:1;
921924
unsigned int supports_autosuspend:1;
925+
unsigned int disable_hub_initiated_lpm:1;
922926
unsigned int soft_unbind:1;
923927
};
924928
#define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver)

0 commit comments

Comments
 (0)