diff options
Diffstat (limited to 'drivers/usb/host/xhci-pci.c')
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 04f986d9234f..47390e369cd4 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -190,6 +190,10 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
190 | struct usb_hcd *hcd; | 190 | struct usb_hcd *hcd; |
191 | 191 | ||
192 | driver = (struct hc_driver *)id->driver_data; | 192 | driver = (struct hc_driver *)id->driver_data; |
193 | |||
194 | /* Prevent runtime suspending between USB-2 and USB-3 initialization */ | ||
195 | pm_runtime_get_noresume(&dev->dev); | ||
196 | |||
193 | /* Register the USB 2.0 roothub. | 197 | /* Register the USB 2.0 roothub. |
194 | * FIXME: USB core must know to register the USB 2.0 roothub first. | 198 | * FIXME: USB core must know to register the USB 2.0 roothub first. |
195 | * This is sort of silly, because we could just set the HCD driver flags | 199 | * This is sort of silly, because we could just set the HCD driver flags |
@@ -199,7 +203,7 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
199 | retval = usb_hcd_pci_probe(dev, id); | 203 | retval = usb_hcd_pci_probe(dev, id); |
200 | 204 | ||
201 | if (retval) | 205 | if (retval) |
202 | return retval; | 206 | goto put_runtime_pm; |
203 | 207 | ||
204 | /* USB 2.0 roothub is stored in the PCI device now. */ | 208 | /* USB 2.0 roothub is stored in the PCI device now. */ |
205 | hcd = dev_get_drvdata(&dev->dev); | 209 | hcd = dev_get_drvdata(&dev->dev); |
@@ -222,11 +226,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
222 | goto put_usb3_hcd; | 226 | goto put_usb3_hcd; |
223 | /* Roothub already marked as USB 3.0 speed */ | 227 | /* Roothub already marked as USB 3.0 speed */ |
224 | 228 | ||
225 | /* We know the LPM timeout algorithms for this host, let the USB core | 229 | if (HCC_MAX_PSA(xhci->hcc_params) >= 4) |
226 | * enable and disable LPM for devices under the USB 3.0 roothub. | 230 | xhci->shared_hcd->can_do_streams = 1; |
227 | */ | 231 | |
228 | if (xhci->quirks & XHCI_LPM_SUPPORT) | 232 | /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ |
229 | hcd_to_bus(xhci->shared_hcd)->root_hub->lpm_capable = 1; | 233 | pm_runtime_put_noidle(&dev->dev); |
230 | 234 | ||
231 | return 0; | 235 | return 0; |
232 | 236 | ||
@@ -234,6 +238,8 @@ put_usb3_hcd: | |||
234 | usb_put_hcd(xhci->shared_hcd); | 238 | usb_put_hcd(xhci->shared_hcd); |
235 | dealloc_usb2_hcd: | 239 | dealloc_usb2_hcd: |
236 | usb_hcd_pci_remove(dev); | 240 | usb_hcd_pci_remove(dev); |
241 | put_runtime_pm: | ||
242 | pm_runtime_put_noidle(&dev->dev); | ||
237 | return retval; | 243 | return retval; |
238 | } | 244 | } |
239 | 245 | ||