]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
usb: Add quirk for enabling workaround for BULK IN streams
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Fri, 30 Jun 2017 10:28:09 +0000 (15:58 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 10 Jul 2017 07:37:58 +0000 (09:37 +0200)
This patch adds support for enabling workaround for BULK IN stream
rings by adding "xhci-stream-quirk" flag to dts node. Enabling this
flag activates the timer for every BULK IN stream ring at the time
of queuing TRB's into BULK IN stream ring.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Documentation/devicetree/bindings/usb/dwc3.txt
arch/arm64/boot/dts/xilinx/zynqmp.dtsi
drivers/usb/dwc3/host.c
drivers/usb/host/xhci-plat.c

index 42b948145bac3477e6b5e6e9ddff69edd060831e..ac63190ed6f05533906ff38123092a3ea1cddd08 100644 (file)
@@ -60,6 +60,11 @@ Optional properties:
  - snps,enable_guctl1_ipd_quirk: Adding this flag sets bit 9 of GUCTL1
        enabling the workaround in HW to reduce the Inter Packet Delay (IPD)
        and making controller enumerate FS/LS devices connected behind VIA-LAB.
+ - snps,xhci-stream-quirk: Dwc3 host controller has a bug where it sometimes
+       fails to process the traansfer descriptors present in the BULK IN
+       stream ring. Since the controller is not processing any TD, no transfer
+       events will be triggered, resulting in a hang condition. Enabling this
+       flag in dts fixes the above said issue.
 
  - <DEPRECATED> tx-fifo-resize: determines if the FIFO *has* to be reallocated.
 
index b37ecad92e3c85546d031d8e4c1f29165491a85d..5ce70f70400d17f5829023fc6ade47fa56382e8e 100644 (file)
                                snps,refclk_fladj;
                                snps,enable_guctl1_resume_quirk;
                                snps,enable_guctl1_ipd_quirk;
+                               snps,xhci-stream-quirk;
                                /* dma-coherent; */
                        };
                };
                                snps,refclk_fladj;
                                snps,enable_guctl1_resume_quirk;
                                snps,enable_guctl1_ipd_quirk;
+                               snps,xhci-stream-quirk;
                                /* dma-coherent; */
                        };
                };
index 7d8bf538adac1c09b6bbaaae56ae435769d75815..7ccdfd26fef152388f2109ca6705be610a19e43d 100644 (file)
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-       struct property_entry   props[2];
+       struct property_entry   props[3];
        struct platform_device  *xhci;
        int                     ret, irq;
+       unsigned int            index = 0;
        struct resource         *res;
        struct platform_device  *dwc3_pdev = to_platform_device(dwc->dev);
 
@@ -97,8 +98,14 @@ int dwc3_host_init(struct dwc3 *dwc)
 
        memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
 
-       if (dwc->usb3_lpm_capable) {
-               props[0].name = "usb3-lpm-capable";
+       if (dwc->usb3_lpm_capable)
+               props[index++].name = "usb3-lpm-capable";
+
+       if (device_property_read_bool(&dwc3_pdev->dev,
+                                       "snps,xhci-stream-quirk"))
+               props[index++].name = "xhci-stream-quirk";
+
+       if (index > 0) {
                ret = platform_device_add_properties(xhci, props);
                if (ret) {
                        dev_err(dwc->dev, "failed to add properties to xHCI\n");
index 12d9ba16c99d9384b23f7416f9e02a6a66de4ef0..31df62f438e79e597a0ba70af10875c3df16ca62 100644 (file)
@@ -252,6 +252,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
        if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable"))
                xhci->quirks |= XHCI_LPM_SUPPORT;
 
+       if (device_property_read_bool(&pdev->dev, "xhci-stream-quirk"))
+               xhci->quirks |= XHCI_STREAM_QUIRK;
 
        hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
        if (IS_ERR(hcd->usb_phy)) {