]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
usb: dwc3: of-simple: Fix kernel hang during unbind
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Wed, 14 Sep 2016 13:57:12 +0000 (19:27 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 15 Sep 2016 16:22:48 +0000 (18:22 +0200)
In dwc3_of_simple_remove() we call of_platform_depopulate() after
disabling the clocks. Since of_platform_depopulate() calls xhci_stop()
which internally stop the controller by programming the USB registers.
Since we already disabled the USB clock, kernel hangs when try to unbind.

This patch corrects the above said issue by calling of_platform_depopulate
before clock disabling.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Tested-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/dwc3/dwc3-of-simple.c

index a2e0e18de38a5a23f85c43fd3ac0ca1fe1d23ace..13301631cdd0260e67ff1f259ebd33105a4ff4ec 100644 (file)
@@ -112,13 +112,13 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
        struct device           *dev = &pdev->dev;
        int                     i;
 
+       of_platform_depopulate(dev);
+
        for (i = 0; i < simple->num_clocks; i++) {
                clk_disable_unprepare(simple->clks[i]);
                clk_put(simple->clks[i]);
        }
 
-       of_platform_depopulate(dev);
-
        pm_runtime_put_sync(dev);
        pm_runtime_disable(dev);