diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2005-11-14 11:45:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-04 16:48:31 -0500 |
commit | 1c50c317e2e7f15427149cbc216a63366468710e (patch) | |
tree | d48dc0b03090e89c644f73f9997b4f70b6ec9b41 /drivers/usb/host/ehci-pci.c | |
parent | 8364d6b0be2dbbf162c6aea79615b5025a0d67c2 (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/ehci-pci.c')
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 9 |
1 files changed, 1 insertions, 8 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 | ||
313 | restart: | 312 | restart: |
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. |