aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-04-27 15:54:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 18:04:09 -0400
commit4489a5712b086621a6c3f669057d2996245cd3fb (patch)
treef79eb7f00a4d95eb7505b2f29283b2ce927feac4
parent9effa978f1d51f6d0426ebabcf6cb32336bb3153 (diff)
[PATCH] USB: usbcore: always turn on hub port power
Some hubs claim not to support port-power switching, and right now the hub driver believes them and does not enable power to their ports. However it turns out that even though they don't actually switch power, they do ignore all events on a port until told to turn on the power! This problem has been reported by several users. This revised patch (as672b) makes the hub driver always try to turn on port power to all hubs, regardless of what the hub descriptor says. It also adds a comment explaining the need for this. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/hub.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 90b8d43c6b33..1b1846e6473b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -432,15 +432,22 @@ static void hub_power_on(struct usb_hub *hub)
432{ 432{
433 int port1; 433 int port1;
434 unsigned pgood_delay = hub->descriptor->bPwrOn2PwrGood * 2; 434 unsigned pgood_delay = hub->descriptor->bPwrOn2PwrGood * 2;
435 u16 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics); 435 u16 wHubCharacteristics =
436 436 le16_to_cpu(hub->descriptor->wHubCharacteristics);
437 /* if hub supports power switching, enable power on each port */ 437
438 if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2) { 438 /* Enable power on each port. Some hubs have reserved values
439 * of LPSM (> 2) in their descriptors, even though they are
440 * USB 2.0 hubs. Some hubs do not implement port-power switching
441 * but only emulate it. In all cases, the ports won't work
442 * unless we send these messages to the hub.
443 */
444 if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2)
439 dev_dbg(hub->intfdev, "enabling power on all ports\n"); 445 dev_dbg(hub->intfdev, "enabling power on all ports\n");
440 for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++) 446 else
441 set_port_feature(hub->hdev, port1, 447 dev_dbg(hub->intfdev, "trying to enable port power on "
442 USB_PORT_FEAT_POWER); 448 "non-switchable hub\n");
443 } 449 for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++)
450 set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);
444 451
445 /* Wait at least 100 msec for power to become stable */ 452 /* Wait at least 100 msec for power to become stable */
446 msleep(max(pgood_delay, (unsigned) 100)); 453 msleep(max(pgood_delay, (unsigned) 100));