diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-04-04 14:47:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:12:26 -0400 |
commit | 8e32640672bdcb01e0d83f087f09dd65fcbc3275 (patch) | |
tree | 8e65907cb076ae5598df469d120a8d4cece16800 /drivers/usb/host/uhci-hub.c | |
parent | 01e89506351b84ac6f39eb70f99c71483768ca60 (diff) |
[PATCH] USB: UHCI: don't track suspended ports
Someone recently posted a bug report where it turned out that uhci-hcd
was disagreeing with the UHCI controller over whether or not a port was
suspended: The driver thought it wasn't and the hardware thought it was.
This patch (as665) fixes the problem and simplifies the driver by
removing the internal state-tracking completely. Now the driver just
asks the hardware whether a port is suspended.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-hub.c')
-rw-r--r-- | drivers/usb/host/uhci-hub.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index 152971d16769..c8451d9578f1 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -85,11 +85,10 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, | |||
85 | { | 85 | { |
86 | int status; | 86 | int status; |
87 | 87 | ||
88 | if (test_bit(port, &uhci->suspended_ports)) { | 88 | if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) { |
89 | CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); | 89 | CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); |
90 | clear_bit(port, &uhci->suspended_ports); | 90 | if (test_bit(port, &uhci->resuming_ports)) |
91 | clear_bit(port, &uhci->resuming_ports); | 91 | set_bit(port, &uhci->port_c_suspend); |
92 | set_bit(port, &uhci->port_c_suspend); | ||
93 | 92 | ||
94 | /* The controller won't actually turn off the RD bit until | 93 | /* The controller won't actually turn off the RD bit until |
95 | * it has had a chance to send a low-speed EOP sequence, | 94 | * it has had a chance to send a low-speed EOP sequence, |
@@ -97,6 +96,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, | |||
97 | * slightly longer for good luck. */ | 96 | * slightly longer for good luck. */ |
98 | udelay(4); | 97 | udelay(4); |
99 | } | 98 | } |
99 | clear_bit(port, &uhci->resuming_ports); | ||
100 | } | 100 | } |
101 | 101 | ||
102 | /* Wait for the UHCI controller in HP's iLO2 server management chip. | 102 | /* Wait for the UHCI controller in HP's iLO2 server management chip. |
@@ -265,8 +265,6 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
265 | wPortChange |= USB_PORT_STAT_C_SUSPEND; | 265 | wPortChange |= USB_PORT_STAT_C_SUSPEND; |
266 | lstatus |= 1; | 266 | lstatus |= 1; |
267 | } | 267 | } |
268 | if (test_bit(port, &uhci->suspended_ports)) | ||
269 | lstatus |= 2; | ||
270 | if (test_bit(port, &uhci->resuming_ports)) | 268 | if (test_bit(port, &uhci->resuming_ports)) |
271 | lstatus |= 4; | 269 | lstatus |= 4; |
272 | 270 | ||
@@ -309,7 +307,6 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
309 | 307 | ||
310 | switch (wValue) { | 308 | switch (wValue) { |
311 | case USB_PORT_FEAT_SUSPEND: | 309 | case USB_PORT_FEAT_SUSPEND: |
312 | set_bit(port, &uhci->suspended_ports); | ||
313 | SET_RH_PORTSTAT(USBPORTSC_SUSP); | 310 | SET_RH_PORTSTAT(USBPORTSC_SUSP); |
314 | OK(0); | 311 | OK(0); |
315 | case USB_PORT_FEAT_RESET: | 312 | case USB_PORT_FEAT_RESET: |
@@ -343,8 +340,11 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
343 | CLR_RH_PORTSTAT(USBPORTSC_PEC); | 340 | CLR_RH_PORTSTAT(USBPORTSC_PEC); |
344 | OK(0); | 341 | OK(0); |
345 | case USB_PORT_FEAT_SUSPEND: | 342 | case USB_PORT_FEAT_SUSPEND: |
346 | if (test_bit(port, &uhci->suspended_ports) && | 343 | if (!(inw(port_addr) & USBPORTSC_SUSP)) { |
347 | !test_and_set_bit(port, | 344 | |
345 | /* Make certain the port isn't suspended */ | ||
346 | uhci_finish_suspend(uhci, port, port_addr); | ||
347 | } else if (!test_and_set_bit(port, | ||
348 | &uhci->resuming_ports)) { | 348 | &uhci->resuming_ports)) { |
349 | SET_RH_PORTSTAT(USBPORTSC_RD); | 349 | SET_RH_PORTSTAT(USBPORTSC_RD); |
350 | 350 | ||