aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hcd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-27 12:32:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-27 12:32:20 -0400
commit1993cbf06aa95c0fcf080f2e858c116306b6c29e (patch)
tree48fed02d854e4a1133fcd380da5627401e6292d4 /drivers/usb/core/hcd.c
parent7ff5000268355c63dc948ecb01f4de17987586e5 (diff)
parent573a094873752d225041b1059a662eca013a54f4 (diff)
Merge tag 'usb-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a number of USB driver fixes for reported problems for 4.17-rc3. The "largest" here is a number of phy core changes for reported problems with the -rc1 release. There's also the usual musb and xhci fixes, as well as new device id updates. There are also some usbip fixes for reported problems as more people start to use that code with containers. All of these have been in linux-next with no reported issues, except the last few new device ids, which are "obviously correct" :)" * tag 'usb-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits) USB: musb: dsps: drop duplicate phy initialisation USB: musb: host: prevent core phy initialisation usb: core: phy: add the SPDX-License-Identifier and include guard xhci: Fix Kernel oops in xhci dbgtty usb: select USB_COMMON for usb role switch config usb: core: phy: add missing forward declaration for "struct device" usb: core: phy: make it a no-op if CONFIG_GENERIC_PHY is disabled usb: core: use phy_exit during suspend if wake up is not supported usb: core: split usb_phy_roothub_{init,alloc} usb: core: phy: fix return value of usb_phy_roothub_exit() usb: typec: ucsi: Increase command completion timeout value Revert "xhci: plat: Register shutdown for xhci_plat" usb: core: Add quirk for HP v222w 16GB Mini Documentation: typec.rst: Use literal-block element with ascii art usb: typec: ucsi: fix tracepoint related build error usbip: usbip_event: fix to not print kernel pointer address usbip: usbip_host: fix to hold parent lock for device_attach() calls usbip: vhci_hcd: Fix usb device and sockfd leaks usbip: vhci_hcd: check rhport before using in vhci_hub_control() USB: Increment wakeup count on remote wakeup. ...
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r--drivers/usb/core/hcd.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 777036ae6367..0a42c5df3c0f 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2262,7 +2262,8 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
2262 hcd->state = HC_STATE_SUSPENDED; 2262 hcd->state = HC_STATE_SUSPENDED;
2263 2263
2264 if (!PMSG_IS_AUTO(msg)) 2264 if (!PMSG_IS_AUTO(msg))
2265 usb_phy_roothub_power_off(hcd->phy_roothub); 2265 usb_phy_roothub_suspend(hcd->self.sysdev,
2266 hcd->phy_roothub);
2266 2267
2267 /* Did we race with a root-hub wakeup event? */ 2268 /* Did we race with a root-hub wakeup event? */
2268 if (rhdev->do_remote_wakeup) { 2269 if (rhdev->do_remote_wakeup) {
@@ -2302,7 +2303,8 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
2302 } 2303 }
2303 2304
2304 if (!PMSG_IS_AUTO(msg)) { 2305 if (!PMSG_IS_AUTO(msg)) {
2305 status = usb_phy_roothub_power_on(hcd->phy_roothub); 2306 status = usb_phy_roothub_resume(hcd->self.sysdev,
2307 hcd->phy_roothub);
2306 if (status) 2308 if (status)
2307 return status; 2309 return status;
2308 } 2310 }
@@ -2344,7 +2346,7 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
2344 } 2346 }
2345 } else { 2347 } else {
2346 hcd->state = old_state; 2348 hcd->state = old_state;
2347 usb_phy_roothub_power_off(hcd->phy_roothub); 2349 usb_phy_roothub_suspend(hcd->self.sysdev, hcd->phy_roothub);
2348 dev_dbg(&rhdev->dev, "bus %s fail, err %d\n", 2350 dev_dbg(&rhdev->dev, "bus %s fail, err %d\n",
2349 "resume", status); 2351 "resume", status);
2350 if (status != -ESHUTDOWN) 2352 if (status != -ESHUTDOWN)
@@ -2377,6 +2379,7 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd)
2377 2379
2378 spin_lock_irqsave (&hcd_root_hub_lock, flags); 2380 spin_lock_irqsave (&hcd_root_hub_lock, flags);
2379 if (hcd->rh_registered) { 2381 if (hcd->rh_registered) {
2382 pm_wakeup_event(&hcd->self.root_hub->dev, 0);
2380 set_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); 2383 set_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags);
2381 queue_work(pm_wq, &hcd->wakeup_work); 2384 queue_work(pm_wq, &hcd->wakeup_work);
2382 } 2385 }
@@ -2758,12 +2761,16 @@ int usb_add_hcd(struct usb_hcd *hcd,
2758 } 2761 }
2759 2762
2760 if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { 2763 if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
2761 hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev); 2764 hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
2762 if (IS_ERR(hcd->phy_roothub)) { 2765 if (IS_ERR(hcd->phy_roothub)) {
2763 retval = PTR_ERR(hcd->phy_roothub); 2766 retval = PTR_ERR(hcd->phy_roothub);
2764 goto err_phy_roothub_init; 2767 goto err_phy_roothub_alloc;
2765 } 2768 }
2766 2769
2770 retval = usb_phy_roothub_init(hcd->phy_roothub);
2771 if (retval)
2772 goto err_phy_roothub_alloc;
2773
2767 retval = usb_phy_roothub_power_on(hcd->phy_roothub); 2774 retval = usb_phy_roothub_power_on(hcd->phy_roothub);
2768 if (retval) 2775 if (retval)
2769 goto err_usb_phy_roothub_power_on; 2776 goto err_usb_phy_roothub_power_on;
@@ -2936,7 +2943,7 @@ err_create_buf:
2936 usb_phy_roothub_power_off(hcd->phy_roothub); 2943 usb_phy_roothub_power_off(hcd->phy_roothub);
2937err_usb_phy_roothub_power_on: 2944err_usb_phy_roothub_power_on:
2938 usb_phy_roothub_exit(hcd->phy_roothub); 2945 usb_phy_roothub_exit(hcd->phy_roothub);
2939err_phy_roothub_init: 2946err_phy_roothub_alloc:
2940 if (hcd->remove_phy && hcd->usb_phy) { 2947 if (hcd->remove_phy && hcd->usb_phy) {
2941 usb_phy_shutdown(hcd->usb_phy); 2948 usb_phy_shutdown(hcd->usb_phy);
2942 usb_put_phy(hcd->usb_phy); 2949 usb_put_phy(hcd->usb_phy);