aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-11-14 11:45:38 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:48:31 -0500
commit1c50c317e2e7f15427149cbc216a63366468710e (patch)
treed48dc0b03090e89c644f73f9997b4f70b6ec9b41 /drivers/usb/host
parent8364d6b0be2dbbf162c6aea79615b5025a0d67c2 (diff)
[PATCH] USB: central handling for host controllers that were reset during suspend/resume
This patch (as515b) adds a routine to usbcore to simplify handling of host controllers that lost power or were reset during suspend/resume. The new core routine marks all the child devices of the root hub as NOTATTACHED and tells khubd to disconnect the device structures as soon as possible. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-pci.c9
-rw-r--r--drivers/usb/host/ohci-hcd.c7
-rw-r--r--drivers/usb/host/sl811-hcd.c1
-rw-r--r--drivers/usb/host/uhci-hcd.c6
4 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index ac088bc72f1c..08ca0f849dab 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -278,7 +278,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
278{ 278{
279 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 279 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
280 unsigned port; 280 unsigned port;
281 struct usb_device *root = hcd->self.root_hub;
282 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 281 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
283 int retval = -EINVAL; 282 int retval = -EINVAL;
284 283
@@ -312,13 +311,7 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
312 311
313restart: 312restart:
314 ehci_dbg(ehci, "lost power, restarting\n"); 313 ehci_dbg(ehci, "lost power, restarting\n");
315 for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) { 314 usb_root_hub_lost_power(hcd->self.root_hub);
316 port--;
317 if (!root->children [port])
318 continue;
319 usb_set_device_state(root->children[port],
320 USB_STATE_NOTATTACHED);
321 }
322 315
323 /* Else reset, to cope with power loss or flush-to-storage 316 /* Else reset, to cope with power loss or flush-to-storage
324 * style "resume" having let BIOS kick in during reboot. 317 * style "resume" having let BIOS kick in during reboot.
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index e3af3ac4416a..a4b12404ae08 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -795,7 +795,6 @@ static int ohci_restart (struct ohci_hcd *ohci)
795 int temp; 795 int temp;
796 int i; 796 int i;
797 struct urb_priv *priv; 797 struct urb_priv *priv;
798 struct usb_device *root = ohci_to_hcd(ohci)->self.root_hub;
799 798
800 /* mark any devices gone, so they do nothing till khubd disconnects. 799 /* mark any devices gone, so they do nothing till khubd disconnects.
801 * recycle any "live" eds/tds (and urbs) right away. 800 * recycle any "live" eds/tds (and urbs) right away.
@@ -804,11 +803,7 @@ static int ohci_restart (struct ohci_hcd *ohci)
804 */ 803 */
805 spin_lock_irq(&ohci->lock); 804 spin_lock_irq(&ohci->lock);
806 disable (ohci); 805 disable (ohci);
807 for (i = 0; i < root->maxchild; i++) { 806 usb_root_hub_lost_power(ohci_to_hcd(ohci)->self.root_hub);
808 if (root->children [i])
809 usb_set_device_state (root->children[i],
810 USB_STATE_NOTATTACHED);
811 }
812 if (!list_empty (&ohci->pending)) 807 if (!list_empty (&ohci->pending))
813 ohci_dbg(ohci, "abort schedule...\n"); 808 ohci_dbg(ohci, "abort schedule...\n");
814 list_for_each_entry (priv, &ohci->pending, pending) { 809 list_for_each_entry (priv, &ohci->pending, pending) {
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 3a9cd4607962..517360b77d8e 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1803,6 +1803,7 @@ sl811h_resume(struct platform_device *dev)
1803 || !device_can_wakeup(&hcd->self.root_hub->dev)) { 1803 || !device_can_wakeup(&hcd->self.root_hub->dev)) {
1804 sl811->port1 = 0; 1804 sl811->port1 = 0;
1805 port_power(sl811, 1); 1805 port_power(sl811, 1);
1806 usb_root_hub_lost_power(hcd->self.root_hub);
1806 return 0; 1807 return 0;
1807 } 1808 }
1808 1809
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 1c0394cb3c89..071fab6b6475 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -748,8 +748,12 @@ static int uhci_resume(struct usb_hcd *hcd)
748 check_and_reset_hc(uhci); 748 check_and_reset_hc(uhci);
749 configure_hc(uhci); 749 configure_hc(uhci);
750 750
751 if (uhci->rh_state == UHCI_RH_RESET) 751 if (uhci->rh_state == UHCI_RH_RESET) {
752
753 /* The controller had to be reset */
754 usb_root_hub_lost_power(hcd->self.root_hub);
752 suspend_rh(uhci, UHCI_RH_SUSPENDED); 755 suspend_rh(uhci, UHCI_RH_SUSPENDED);
756 }
753 757
754 spin_unlock_irq(&uhci->lock); 758 spin_unlock_irq(&uhci->lock);
755 759