Author: kaloz
Date: 2015-03-26 15:32:45 +0100 (Thu, 26 Mar 2015)
New Revision: 45026

Added:
   trunk/target/linux/mvebu/patches-3.18/210-xhci_move_marvell_quirks.patch
Modified:
   trunk/package/kernel/linux/modules/usb.mk
Log:
mvebu: fixup usb3 support on the a38x

Signed-off-by: Imre Kaloz <[email protected]>



Modified: trunk/package/kernel/linux/modules/usb.mk
===================================================================
--- trunk/package/kernel/linux/modules/usb.mk   2015-03-26 14:06:42 UTC (rev 
45025)
+++ trunk/package/kernel/linux/modules/usb.mk   2015-03-26 14:32:45 UTC (rev 
45026)
@@ -1480,6 +1480,7 @@
        CONFIG_USB_XHCI_HCD \
        CONFIG_USB_XHCI_PCI \
        CONFIG_USB_XHCI_PLATFORM \
+       CONFIG_USB_XHCI_MVEBU=y \
        CONFIG_USB_XHCI_HCD_DEBUGGING=n
   FILES:= \
        $(XHCI_FILES)

Added: trunk/target/linux/mvebu/patches-3.18/210-xhci_move_marvell_quirks.patch
===================================================================
--- trunk/target/linux/mvebu/patches-3.18/210-xhci_move_marvell_quirks.patch    
                        (rev 0)
+++ trunk/target/linux/mvebu/patches-3.18/210-xhci_move_marvell_quirks.patch    
2015-03-26 14:32:45 UTC (rev 45026)
@@ -0,0 +1,61 @@
+From 1e7e4fb66489cc84366656ca5318f1cb61afd4ba Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <[email protected]>
+Date: Tue, 24 Feb 2015 18:27:00 +0200
+Subject: usb: XHCI: platform: Move the Marvell quirks after the enabling the
+ clocks
+
+The commit 973747928514 ("usb: host: xhci-plat: add support for the Armada
+375/38x XHCI controllers") extended the xhci-plat driver to support the Armada
+375/38x SoCs, mostly by adding a quirk configuring the MBUS window.
+
+However, that quirk was run before the clock the controllers needs has been
+enabled. This usually worked because the clock was first enabled by the
+bootloader, and left as such until the driver is probe, where it tries to
+access the MBUS configuration registers before enabling the clock.
+
+Things get messy when EPROBE_DEFER is involved during the probe, since as part
+of its error path, the driver will rightfully disable the clock. When the
+driver will be reprobed, it will retry to access the MBUS registers, but this
+time with the clock disabled, which hangs forever.
+
+Fix this by running the quirks after the clock has been enabled by the driver.
+
+Signed-off-by: Maxime Ripard <[email protected]>
+Cc: <[email protected]> # v3.16+
+Signed-off-by: Mathias Nyman <[email protected]>
+Signed-off-by: Greg Kroah-Hartman <[email protected]>
+
+--- a/drivers/usb/host/xhci-plat.c
++++ b/drivers/usb/host/xhci-plat.c
+@@ -87,15 +87,6 @@ static int xhci_plat_probe(struct platfo
+       if (!res)
+               return -ENODEV;
+ 
+-      if (of_device_is_compatible(pdev->dev.of_node,
+-                                  "marvell,armada-375-xhci") ||
+-          of_device_is_compatible(pdev->dev.of_node,
+-                                  "marvell,armada-380-xhci")) {
+-              ret = xhci_mvebu_mbus_init_quirk(pdev);
+-              if (ret)
+-                      return ret;
+-      }
+-
+       /* Initialize dma_mask and coherent_dma_mask to 32-bits */
+       ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+       if (ret)
+@@ -129,6 +120,15 @@ static int xhci_plat_probe(struct platfo
+                       goto put_hcd;
+       }
+ 
++      if (of_device_is_compatible(pdev->dev.of_node,
++                                  "marvell,armada-375-xhci") ||
++          of_device_is_compatible(pdev->dev.of_node,
++                                  "marvell,armada-380-xhci")) {
++              ret = xhci_mvebu_mbus_init_quirk(pdev);
++              if (ret)
++                      return ret;
++      }
++
+       ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
+       if (ret)
+               goto disable_clk;
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to