Skip to content

Commit

Permalink
USB: Disable hub-initiated LPM for comms devices.
Browse files Browse the repository at this point in the history
Hub-initiated LPM is not good for USB communications devices.  Comms
devices should be able to tell when their link can go into a lower power
state, because they know when an incoming transmission is finished.
Ideally, these devices would slam their links into a lower power state,
using the device-initiated LPM, after finishing the last packet of their
data transfer.

If we enable the idle timeouts for the parent hubs to enable
hub-initiated LPM, we will get a lot of useless LPM packets on the bus
as the devices reject LPM transitions when they're in the middle of
receiving data.  Worse, some devices might blindly accept the
hub-initiated LPM and power down their radios while they're in the
middle of receiving a transmission.

The Intel Windows folks are disabling hub-initiated LPM for all USB
communications devices under a xHCI USB 3.0 host.  In order to keep
the Linux behavior as close as possible to Windows, we need to do the
same in Linux.

Set the disable_hub_initiated_lpm flag for for all USB communications
drivers.  I know there aren't currently any USB 3.0 devices that
implement these class specifications, but we should be ready if they do.

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: 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]>
Signed-off-by: Sarah Sharp <[email protected]>
  • Loading branch information
Sarah Sharp committed May 18, 2012
1 parent e3567d2 commit e1f12eb
Show file tree
Hide file tree
Showing 56 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ static struct usb_driver ath3k_driver = {
.probe = ath3k_probe,
.disconnect = ath3k_disconnect,
.id_table = ath3k_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(ath3k_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/bcm203x.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ static struct usb_driver bcm203x_driver = {
.probe = bcm203x_probe,
.disconnect = bcm203x_disconnect,
.id_table = bcm203x_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(bcm203x_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/bfusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ static struct usb_driver bfusb_driver = {
.probe = bfusb_probe,
.disconnect = bfusb_disconnect,
.id_table = bfusb_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(bfusb_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ static struct usb_driver bpa10x_driver = {
.probe = bpa10x_probe,
.disconnect = bpa10x_disconnect,
.id_table = bpa10x_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(bpa10x_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ static struct usb_driver btusb_driver = {
#endif
.id_table = btusb_table,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(btusb_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/isdn/gigaset/bas-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ static struct usb_driver gigaset_usb_driver = {
.reset_resume = gigaset_post_reset,
.pre_reset = gigaset_pre_reset,
.post_reset = gigaset_post_reset,
.disable_hub_initiated_lpm = 1,
};

/* get message text for usb_submit_urb return code
Expand Down
1 change: 1 addition & 0 deletions drivers/isdn/gigaset/usb-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static struct usb_driver gigaset_usb_driver = {
.reset_resume = gigaset_resume,
.pre_reset = gigaset_pre_reset,
.post_reset = gigaset_resume,
.disable_hub_initiated_lpm = 1,
};

struct usb_cardstate {
Expand Down
1 change: 1 addition & 0 deletions drivers/isdn/hardware/mISDN/hfcsusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,7 @@ static struct usb_driver hfcsusb_drv = {
.id_table = hfcsusb_idtab,
.probe = hfcsusb_probe,
.disconnect = hfcsusb_disconnect,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(hfcsusb_drv);
1 change: 1 addition & 0 deletions drivers/isdn/hisax/hfc_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ static struct usb_driver hfc_drv = {
.id_table = hfcusb_idtab,
.probe = hfc_usb_probe,
.disconnect = hfc_usb_disconnect,
.disable_hub_initiated_lpm = 1,
};

static void __exit
Expand Down
1 change: 1 addition & 0 deletions drivers/isdn/hisax/st5481_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ static struct usb_driver st5481_usb_driver = {
.probe = probe_st5481,
.disconnect = disconnect_st5481,
.id_table = st5481_ids,
.disable_hub_initiated_lpm = 1,
};

static int __init st5481_usb_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,7 @@ static struct usb_driver asix_driver = {
.resume = usbnet_resume,
.disconnect = usbnet_disconnect,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(asix_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ static struct usb_driver catc_driver = {
.probe = catc_probe,
.disconnect = catc_disconnect,
.id_table = catc_id_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(catc_driver);
1 change: 1 addition & 0 deletions drivers/net/usb/cdc-phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ static struct usb_driver usbpn_driver = {
.probe = usbpn_probe,
.disconnect = usbpn_disconnect,
.id_table = usbpn_ids,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(usbpn_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/cdc_eem.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ static struct usb_driver eem_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(eem_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/cdc_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ static struct usb_driver cdc_driver = {
.resume = usbnet_resume,
.reset_resume = usbnet_resume,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(cdc_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ static struct usb_driver cdc_ncm_driver = {
.resume = usbnet_resume,
.reset_resume = usbnet_resume,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

static const struct ethtool_ops cdc_ncm_ethtool_ops = {
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/cdc_subset.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ static struct usb_driver cdc_subset_driver = {
.resume = usbnet_resume,
.disconnect = usbnet_disconnect,
.id_table = products,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(cdc_subset_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/cx82310_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ static struct usb_driver cx82310_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(cx82310_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ static struct usb_driver dm9601_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(dm9601_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/gl620a.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ static struct usb_driver gl620a_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(gl620a_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,6 +3291,7 @@ static struct usb_driver hso_driver = {
.resume = hso_resume,
.reset_resume = hso_resume,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

static int __init hso_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/int51x1.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ static struct usb_driver int51x1_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(int51x1_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/ipheth.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ static struct usb_driver ipheth_driver = {
.probe = ipheth_probe,
.disconnect = ipheth_disconnect,
.id_table = ipheth_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(ipheth_driver);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/usb/kalmia.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ static struct usb_driver kalmia_driver = {
.probe = usbnet_probe,
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(kalmia_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/kaweth.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static struct usb_driver kaweth_driver = {
.resume = kaweth_resume,
.id_table = usb_klsi_table,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

typedef __u8 eth_addr_t[6];
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/lg-vl600.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ static struct usb_driver lg_vl600_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(lg_vl600_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/mcs7830.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ static struct usb_driver mcs7830_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.reset_resume = mcs7830_reset_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(mcs7830_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/net1080.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ static struct usb_driver net1080_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(net1080_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,7 @@ static struct usb_driver pegasus_driver = {
.id_table = pegasus_ids,
.suspend = pegasus_suspend,
.resume = pegasus_resume,
.disable_hub_initiated_lpm = 1,
};

static void __init parse_id(char *id)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/plusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static struct usb_driver plusb_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(plusb_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/qmi_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ static struct usb_driver qmi_wwan_driver = {
.resume = qmi_wwan_resume,
.reset_resume = qmi_wwan_resume,
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

static int __init qmi_wwan_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/rndis_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ static struct usb_driver rndis_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(rndis_driver);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/usb/rtl8150.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,8 @@ static struct usb_driver rtl8150_driver = {
.disconnect = rtl8150_disconnect,
.id_table = rtl8150_table,
.suspend = rtl8150_suspend,
.resume = rtl8150_resume
.resume = rtl8150_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(rtl8150_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/sierra_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ static struct usb_driver sierra_net_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.no_dynamic_id = 1,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(sierra_net_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/smsc75xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ static struct usb_driver smsc75xx_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disconnect = usbnet_disconnect,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(smsc75xx_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ static struct usb_driver smsc95xx_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disconnect = usbnet_disconnect,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(smsc95xx_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/zaurus.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ static struct usb_driver zaurus_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(zaurus_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/at76c50x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,7 @@ static struct usb_driver at76_driver = {
.probe = at76_probe,
.disconnect = at76_disconnect,
.id_table = dev_table,
.disable_hub_initiated_lpm = 1,
};

static int __init at76_mod_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath6kl/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ static struct usb_driver ath6kl_usb_driver = {
.probe = ath6kl_usb_probe,
.disconnect = ath6kl_usb_remove,
.id_table = ath6kl_usb_ids,
.disable_hub_initiated_lpm = 1,
};

static int ath6kl_usb_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath9k/hif_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,7 @@ static struct usb_driver ath9k_hif_usb_driver = {
#endif
.id_table = ath9k_hif_usb_ids,
.soft_unbind = 1,
.disable_hub_initiated_lpm = 1,
};

int ath9k_hif_usb_init(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/carl9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ static struct usb_driver carl9170_driver = {
.resume = carl9170_usb_resume,
.reset_resume = carl9170_usb_resume,
#endif /* CONFIG_PM */
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(carl9170_driver);
1 change: 1 addition & 0 deletions drivers/net/wireless/brcm80211/brcmfmac/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ static struct usb_driver brcmf_usbdrvr = {
.suspend = brcmf_usb_suspend,
.resume = brcmf_usb_resume,
.supports_autosuspend = 1
.disable_hub_initiated_lpm = 1,
};

void brcmf_usb_exit(void)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ static struct usb_driver if_usb_driver = {
.suspend = if_usb_suspend,
.resume = if_usb_resume,
.reset_resume = if_usb_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(if_usb_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/libertas_tf/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ static struct usb_driver if_usb_driver = {
.id_table = if_usb_table,
.suspend = if_usb_suspend,
.resume = if_usb_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(if_usb_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/orinoco/orinoco_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,7 @@ static struct usb_driver orinoco_driver = {
.probe = ezusb_probe,
.disconnect = ezusb_disconnect,
.id_table = ezusb_table,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(orinoco_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/p54/p54usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ static struct usb_driver p54u_driver = {
.reset_resume = p54u_resume,
#endif /* CONFIG_PM */
.soft_unbind = 1,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(p54u_driver);
1 change: 1 addition & 0 deletions drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3776,6 +3776,7 @@ static struct usb_driver rndis_wlan_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(rndis_wlan_driver);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,7 @@ static struct usb_driver rt2500usb_driver = {
.disconnect = rt2x00usb_disconnect,
.suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(rt2500usb_driver);
1 change: 1 addition & 0 deletions drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ static struct usb_driver rt2800usb_driver = {
.disconnect = rt2x00usb_disconnect,
.suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume,
.disable_hub_initiated_lpm = 1,
};

module_usb_driver(rt2800usb_driver);
Loading

0 comments on commit e1f12eb

Please sign in to comment.