diff options
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 | ||
