diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-19 16:57:51 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-19 16:57:51 -0700 |
commit | 4c4e15966df37b0d3863a76b47fc2929ac9e9123 (patch) | |
tree | 748e51bd8b0d84afba9907c9bf73d970a02807ea | |
parent | bd479f293370d863953aba59130bcc7ae867dd10 (diff) | |
parent | 5845c13a70b40f1ce4dfe83acb7796bed8a60672 (diff) |
Merge tag 'for-usb-2013-08-15-step-2' of ra.kernel.org:/pub/scm/linux/kernel/git/sarah/xhci into work-next
Sarah writes:
xhci: Step 2 to fix usb-linus and usb-next.
Hi Greg,
This is the first of two steps to fix your usb-linus and usb-next trees.
As I mentioned, commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66 "USB:
handle LPM errors during device suspend correctly" was incorrectly added
to usb-next when it should have been added to usb-linus and marked for
stable.
Two port power off bug fixes touch the same code that patch touches, but
it's not easy to simply move commit 4fae6f0f patch to usb-linus because
commit 28e861658e23ca94692f98e245d254c75c8088a7 "USB: refactor code for
enabling/disabling remote wakeup" also touched those code sections.
I propose a two step process to fix this:
1. Pull these four patches into usb-linus.
2. Revert commit 28e861658e23ca94692f98e245d254c75c8088a7 from usb-next.
Merge usb-linus into usb-next, and resolve the conflicts.
I will be sending pull requests for these steps.
This pull request is step two.
Sarah Sharp
-rw-r--r-- | drivers/usb/core/hub.c | 14 | ||||
-rw-r--r-- | drivers/usb/core/port.c | 13 | ||||
-rw-r--r-- | drivers/usb/host/xhci-plat.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 1 |
5 files changed, 15 insertions, 22 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 5d6d28a76e0..175179eb17e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3054,19 +3054,9 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) usb_set_device_state(udev, USB_STATE_SUSPENDED); } - /* - * Check whether current status meets the requirement of - * usb port power off mechanism - */ if (status == 0 && !udev->do_remote_wakeup && udev->persist_enabled) { - enum pm_qos_flags_status pm_qos_stat; - - pm_qos_stat = dev_pm_qos_flags(&port_dev->dev, - PM_QOS_FLAG_NO_POWER_OFF); - if (pm_qos_stat != PM_QOS_FLAGS_ALL) { - pm_runtime_put_sync(&port_dev->dev); - port_dev->did_runtime_put = true; - } + pm_runtime_put_sync(&port_dev->dev); + port_dev->did_runtime_put = true; } usb_mark_last_busy(hub->hdev); diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index d6b0fadf53e..9909911665c 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -89,22 +89,19 @@ static int usb_port_runtime_resume(struct device *dev) retval = usb_hub_set_port_power(hdev, hub, port1, true); if (port_dev->child && !retval) { /* - * Wait for usb hub port to be reconnected in order to make - * the resume procedure successful. + * Attempt to wait for usb hub port to be reconnected in order + * to make the resume procedure successful. The device may have + * disconnected while the port was powered off, so ignore the + * return status. */ retval = hub_port_debounce_be_connected(hub, port1); - if (retval < 0) { + if (retval < 0) dev_dbg(&port_dev->dev, "can't get reconnection after setting port power on, status %d\n", retval); - goto out; - } usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE); - - /* Set return value to 0 if debounce successful */ retval = 0; } -out: clear_bit(port1, hub->busy_bits); usb_autopm_put_interface(intf); return retval; diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index be5e70d2300..d9c169f470d 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -26,7 +26,7 @@ static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) * here that the generic code does not try to make a pci_dev from our * dev struct in order to setup MSI */ - xhci->quirks |= XHCI_BROKEN_MSI; + xhci->quirks |= XHCI_PLAT; } /* called during probe() after chip reset completes */ diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index bf11af9a469..ba0ec0a9648 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -348,9 +348,14 @@ static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) static int xhci_try_enable_msi(struct usb_hcd *hcd) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); - struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); + struct pci_dev *pdev; int ret; + /* The xhci platform device has set up IRQs through usb_add_hcd. */ + if (xhci->quirks & XHCI_PLAT) + return 0; + + pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); /* * Some Fresco Logic host controllers advertise MSI, but fail to * generate interrupts. Don't even try to enable MSI. diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index d2045916531..46aa1489414 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1537,6 +1537,7 @@ struct xhci_hcd { #define XHCI_SPURIOUS_REBOOT (1 << 13) #define XHCI_COMP_MODE_QUIRK (1 << 14) #define XHCI_AVOID_BEI (1 << 15) +#define XHCI_PLAT (1 << 16) unsigned int num_active_eps; unsigned int limit_active_eps; /* There are two roothubs to keep track of bus suspend info for */ |