]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00211686 mx6 usb: system crash after suspend/resume
authorTony LIU <junjie.liu@freescale.com>
Wed, 30 May 2012 05:56:38 +0000 (13:56 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:44 +0000 (08:34 +0200)
- the pre-condition of this issue is:
  1. usb gadget must be probed before usb host
  2. usb otg must be in host mode

- the root cause of this issue is
  because of the issue of week 2p5, a vbus change interrupt will
  be issued when system enter into DSM, which will cause system
  exit DSM, so we have a walk aroud to disable usb vbus change
  interrupt when system enter into DSM.

  But this walk around just provent the interrupt generating, the
  vbus change status is still on. When usb gadget is probed, the
  vbus change interrupt will be enabled by its resume interface by
  mistake, and then continuous interrupt will be generated because
  usb otg is in host mode, it can't clear the vbus change status.

  The system have a protect mechanism that when one IRQ's handler
  return IRQ_NONE more than 99000 times, it will through a exception
  to inform such situation. That's the reason why system crash.

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
drivers/usb/gadget/arcotg_udc.c

index ea81802a3ca6a9d282505317a8db799cc0d51d75..842c54eb790f374f5848866079af80d6374fbebf 100755 (executable)
@@ -3432,7 +3432,6 @@ static int fsl_udc_resume(struct platform_device *pdev)
                /* if in host mode, we need to do nothing */
                if ((fsl_readl(&dr_regs->otgsc) & OTGSC_STS_USB_ID) == 0) {
                        dr_phy_low_power_mode(udc_controller, true);
-                       dr_wake_up_enable(udc_controller, true);
                        goto end;
                }
                dr_controller_setup(udc_controller);
@@ -3452,7 +3451,8 @@ end:
                 * subsystem will not leave from low power mode.
                 */
                if (!udc_can_wakeup_system() &&
-                       (pdata->pmflags == 0)) {
+                       (pdata->pmflags == 0) &&
+                       (fsl_readl(&dr_regs->otgsc) & OTGSC_STS_USB_ID)) {
                        dr_wake_up_enable(udc_controller, true);
                }