aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-04-14 12:17:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:53 -0400
commit58a97ffeb2297f154659f339d77eb3f32c4d8b3e (patch)
tree2ca171b7f720769007f9c9624b74ca4ad3442f02 /drivers/usb/host/uhci-hcd.c
parentb950bdbc67041412cb042e404938667204c7902c (diff)
USB: HCDs use the do_remote_wakeup flag
When a USB device is suspended, whether or not it is enabled for remote wakeup depends on the device_may_wakeup() setting. The setting is then saved in the do_remote_wakeup flag. Later on, however, the device_may_wakeup() value can change because of user activity. So when testing whether a suspended device is or should be enabled for remote wakeup, we should always test do_remote_wakeup instead of device_may_wakeup(). This patch (as1076) makes that change for root hubs in several places. The patch also adjusts uhci-hcd so that when an autostopped controller is suspended, the remote wakeup setting agrees with the value recorded in the root hub's do_remote_wakeup flag. And the patch adjusts ehci-hcd so that wakeup events on selectively suspended ports (i.e., the bus itself isn't suspended) don't turn on the PME# wakeup signal. 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-hcd.c')
-rw-r--r--drivers/usb/host/uhci-hcd.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index fec9872dd9d..f65d5a85873 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -262,20 +262,12 @@ __acquires(uhci->lock)
262{ 262{
263 int auto_stop; 263 int auto_stop;
264 int int_enable, egsm_enable; 264 int int_enable, egsm_enable;
265 struct usb_device *rhdev = uhci_to_hcd(uhci)->self.root_hub;
265 266
266 auto_stop = (new_state == UHCI_RH_AUTO_STOPPED); 267 auto_stop = (new_state == UHCI_RH_AUTO_STOPPED);
267 dev_dbg(&uhci_to_hcd(uhci)->self.root_hub->dev, 268 dev_dbg(&rhdev->dev, "%s%s\n", __func__,
268 "%s%s\n", __FUNCTION__,
269 (auto_stop ? " (auto-stop)" : "")); 269 (auto_stop ? " (auto-stop)" : ""));
270 270
271 /* If we get a suspend request when we're already auto-stopped
272 * then there's nothing to do.
273 */
274 if (uhci->rh_state == UHCI_RH_AUTO_STOPPED) {
275 uhci->rh_state = new_state;
276 return;
277 }
278
279 /* Enable resume-detect interrupts if they work. 271 /* Enable resume-detect interrupts if they work.
280 * Then enter Global Suspend mode if _it_ works, still configured. 272 * Then enter Global Suspend mode if _it_ works, still configured.
281 */ 273 */
@@ -285,8 +277,10 @@ __acquires(uhci->lock)
285 if (remote_wakeup_is_broken(uhci)) 277 if (remote_wakeup_is_broken(uhci))
286 egsm_enable = 0; 278 egsm_enable = 0;
287 if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable || 279 if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable ||
288 !device_may_wakeup( 280#ifdef CONFIG_PM
289 &uhci_to_hcd(uhci)->self.root_hub->dev)) 281 (!auto_stop && !rhdev->do_remote_wakeup) ||
282#endif
283 (auto_stop && !device_may_wakeup(&rhdev->dev)))
290 uhci->working_RD = int_enable = 0; 284 uhci->working_RD = int_enable = 0;
291 285
292 outw(int_enable, uhci->io_addr + USBINTR); 286 outw(int_enable, uhci->io_addr + USBINTR);
@@ -308,8 +302,7 @@ __acquires(uhci->lock)
308 return; 302 return;
309 } 303 }
310 if (!(inw(uhci->io_addr + USBSTS) & USBSTS_HCH)) 304 if (!(inw(uhci->io_addr + USBSTS) & USBSTS_HCH))
311 dev_warn(&uhci_to_hcd(uhci)->self.root_hub->dev, 305 dev_warn(uhci_dev(uhci), "Controller not stopped yet!\n");
312 "Controller not stopped yet!\n");
313 306
314 uhci_get_current_frame_number(uhci); 307 uhci_get_current_frame_number(uhci);
315 308