usb: musb: Disable interrupts on suspend, enable them on resume
authorPascal Huerst <pascal.huerst@gmail.com>
Thu, 3 Sep 2015 08:50:58 +0000 (10:50 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 14 Sep 2015 15:14:53 +0000 (10:14 -0500)
In certain situations, an interrupt triggers on resume, before musb_start()
has been called. This has been observed to cause enumeration issues after
suspend/resume cycles with AM335x.

Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_core.c

index d105c6dcbbec4ad667f88517cf95795381249db4..4a518ff123106b0931082bd51f0705c8e8ca0bb7 100644 (file)
@@ -2449,6 +2449,9 @@ static int musb_suspend(struct device *dev)
        struct musb     *musb = dev_to_musb(dev);
        unsigned long   flags;
 
+       musb_platform_disable(musb);
+       musb_generic_disable(musb);
+
        spin_lock_irqsave(&musb->lock, flags);
 
        if (is_peripheral_active(musb)) {
@@ -2502,6 +2505,9 @@ static int musb_resume(struct device *dev)
        pm_runtime_disable(dev);
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
+
+       musb_start(musb);
+
        return 0;
 }