]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'for-usb-2013-08-15-step-2' of ra.kernel.org:/pub/scm/linux/kernel/git...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2013 23:57:51 +0000 (16:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2013 23:57:51 +0000 (16:57 -0700)
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

drivers/usb/core/hub.c
drivers/usb/core/port.c
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index 5d6d28a76e0ac4e63937c5562b6b7ee1e3c9653c..175179eb17eef3ae68e04b12fe59f3c9ec6c9c2d 100644 (file)
@@ -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);
index d6b0fadf53e9de9d3c8b074c50be95b301e176e4..9909911665ce28cf48abe055118e8c71bc5e18ce 100644 (file)
@@ -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;
index be5e70d2300c8ba759b2f43486582ecc10798f0a..d9c169f470d3ebe11b6be5f0cc18927e5bc3d0b3 100644 (file)
@@ -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 */
index bf11af9a46991ce5f12a83970311bb8f73e6b142..ba0ec0a964819168bb916a6888f6fefe3e637832 100644 (file)
@@ -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.
index d2045916531b4bb49d88098f02a8d8592af98969..46aa14894148962e3aff6c8028f8d07cbcb07951 100644 (file)
@@ -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 */