]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00251209-5 usb: fix the system hang when unload gadget module
authorPeter Chen <peter.chen@freescale.com>
Mon, 4 Mar 2013 09:30:08 +0000 (17:30 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:55 +0000 (08:35 +0200)
- For gadget, the clock will be closed at platform code, so
the driver should not be close clock beforehand.
- For host, the PHY should not be low power mode when the host
controller has still possibilities to use. Besides, the 5v should
be off at last as some platform uses 5v for PHY's power.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/gadget/arcotg_udc.c
drivers/usb/host/ehci-arc.c

index d1a2e27bcd562e2029793194c210006d74ed60ec..9d9417f6cce427f243d2a01e97cb727513baa4a8 100755 (executable)
@@ -3299,7 +3299,6 @@ static int  fsl_udc_remove(struct platform_device *pdev)
        release_mem_region(res->start, resource_size(res));
 }
 #endif
-       dr_clk_gate(false);
        device_unregister(&udc_controller->gadget.dev);
        /* free udc --wait for the release() finished */
        wait_for_completion(&done);
index 4a2768a65c2c2de150a78a69dd67049160105278..4a7c606f23fd0b58bd9833eb31e1278b486ac31a 100755 (executable)
@@ -350,9 +350,6 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
                }
        }
 
-       /* DDD shouldn't we turn off the power here? */
-       fsl_platform_set_vbus_power(pdata, 0);
-
        if (ehci->transceiver) {
                (void)otg_set_host(ehci->transceiver, 0);
                otg_put_transceiver(ehci->transceiver);
@@ -361,12 +358,16 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
        }
        /*disable the host wakeup and put phy to low power mode */
        usb_host_set_wakeup(hcd->self.controller, false);
-       fsl_usb_lowpower_mode(pdata, true);
        /*free the ehci_fsl_pre_irq  */
        free_irq(hcd->irq, (void *)pdev);
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
 
+       fsl_usb_lowpower_mode(pdata, true);
+
+       /* DDD shouldn't we turn off the power here? */
+       fsl_platform_set_vbus_power(pdata, 0);
+
        /*
         * do platform specific un-initialization:
         * release iomux pins clocks, etc.