diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-02-13 17:41:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-17 19:56:31 -0500 |
commit | 3494252d5644993f407a45f01c3e8ad5ae38f93c (patch) | |
tree | 01821aeeb26febe7da71ff6968eaed5b28e4b4f7 /drivers | |
parent | e78ac4b9deb8f36d8c828b6d91232960f109d951 (diff) |
USB/PCI: Fix resume breakage of controllers behind cardbus bridges
If a USB PCI controller is behind a cardbus bridge, we are trying to
restore its configuration registers too early, before the cardbus
bridge is operational. To fix this, call pci_restore_state() from
usb_hcd_pci_resume() and remove usb_hcd_pci_resume_early() which is
no longer necessary (the configuration spaces of USB controllers that
are not behind cardbus bridges will be restored by the PCI PM core
with interrupts disabled anyway).
This patch fixes the regression from 2.6.28 tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=12659
[ Side note: the proper long-term fix is probably to just force the
unplug event at suspend time instead of doing a plug/unplug at resume
time, but this patch is fine regardless - Linus ]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 15 | ||||
-rw-r--r-- | drivers/usb/core/hcd.h | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 1 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 1 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 1 |
5 files changed, 2 insertions, 17 deletions
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index c54fc40458b1..a4301dc02d27 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -298,19 +298,6 @@ int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t message) | |||
298 | EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend); | 298 | EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend); |
299 | 299 | ||
300 | /** | 300 | /** |
301 | * usb_hcd_pci_resume_early - resume a PCI-based HCD before IRQs are enabled | ||
302 | * @dev: USB Host Controller being resumed | ||
303 | * | ||
304 | * Store this function in the HCD's struct pci_driver as .resume_early. | ||
305 | */ | ||
306 | int usb_hcd_pci_resume_early(struct pci_dev *dev) | ||
307 | { | ||
308 | pci_restore_state(dev); | ||
309 | return 0; | ||
310 | } | ||
311 | EXPORT_SYMBOL_GPL(usb_hcd_pci_resume_early); | ||
312 | |||
313 | /** | ||
314 | * usb_hcd_pci_resume - power management resume of a PCI-based HCD | 301 | * usb_hcd_pci_resume - power management resume of a PCI-based HCD |
315 | * @dev: USB Host Controller being resumed | 302 | * @dev: USB Host Controller being resumed |
316 | * | 303 | * |
@@ -333,6 +320,8 @@ int usb_hcd_pci_resume(struct pci_dev *dev) | |||
333 | } | 320 | } |
334 | #endif | 321 | #endif |
335 | 322 | ||
323 | pci_restore_state(dev); | ||
324 | |||
336 | hcd = pci_get_drvdata(dev); | 325 | hcd = pci_get_drvdata(dev); |
337 | if (hcd->state != HC_STATE_SUSPENDED) { | 326 | if (hcd->state != HC_STATE_SUSPENDED) { |
338 | dev_dbg(hcd->self.controller, | 327 | dev_dbg(hcd->self.controller, |
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 5b94a56bec23..f750eb1ab595 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -257,7 +257,6 @@ extern void usb_hcd_pci_remove(struct pci_dev *dev); | |||
257 | 257 | ||
258 | #ifdef CONFIG_PM | 258 | #ifdef CONFIG_PM |
259 | extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg); | 259 | extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg); |
260 | extern int usb_hcd_pci_resume_early(struct pci_dev *dev); | ||
261 | extern int usb_hcd_pci_resume(struct pci_dev *dev); | 260 | extern int usb_hcd_pci_resume(struct pci_dev *dev); |
262 | #endif /* CONFIG_PM */ | 261 | #endif /* CONFIG_PM */ |
263 | 262 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index bb21fb0a4969..abb9a7706ec7 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -432,7 +432,6 @@ static struct pci_driver ehci_pci_driver = { | |||
432 | 432 | ||
433 | #ifdef CONFIG_PM | 433 | #ifdef CONFIG_PM |
434 | .suspend = usb_hcd_pci_suspend, | 434 | .suspend = usb_hcd_pci_suspend, |
435 | .resume_early = usb_hcd_pci_resume_early, | ||
436 | .resume = usb_hcd_pci_resume, | 435 | .resume = usb_hcd_pci_resume, |
437 | #endif | 436 | #endif |
438 | .shutdown = usb_hcd_pci_shutdown, | 437 | .shutdown = usb_hcd_pci_shutdown, |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 5d625c3fd423..f9961b4c0da3 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -487,7 +487,6 @@ static struct pci_driver ohci_pci_driver = { | |||
487 | 487 | ||
488 | #ifdef CONFIG_PM | 488 | #ifdef CONFIG_PM |
489 | .suspend = usb_hcd_pci_suspend, | 489 | .suspend = usb_hcd_pci_suspend, |
490 | .resume_early = usb_hcd_pci_resume_early, | ||
491 | .resume = usb_hcd_pci_resume, | 490 | .resume = usb_hcd_pci_resume, |
492 | #endif | 491 | #endif |
493 | 492 | ||
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 944f7e0ca4df..cf5e4cf7ea42 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -942,7 +942,6 @@ static struct pci_driver uhci_pci_driver = { | |||
942 | 942 | ||
943 | #ifdef CONFIG_PM | 943 | #ifdef CONFIG_PM |
944 | .suspend = usb_hcd_pci_suspend, | 944 | .suspend = usb_hcd_pci_suspend, |
945 | .resume_early = usb_hcd_pci_resume_early, | ||
946 | .resume = usb_hcd_pci_resume, | 945 | .resume = usb_hcd_pci_resume, |
947 | #endif /* PM */ | 946 | #endif /* PM */ |
948 | }; | 947 | }; |