]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: chipidea: Prevent unbalanced IRQ disable
authorLoic Poulain <loic.poulain@linaro.org>
Tue, 4 Sep 2018 15:18:57 +0000 (17:18 +0200)
committerPeter Chen <peter.chen@nxp.com>
Thu, 20 Sep 2018 09:04:21 +0000 (17:04 +0800)
The ChipIdea IRQ is disabled before scheduling the otg work and
re-enabled on otg work completion. However if the job is already
scheduled we have to undo the effect of disable_irq int order to
balance the IRQ disable-depth value.

Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/otg.h

index 7e7428e48bfa52e328b8b9bf7d772dc7a3892f49..4f8b8179ec96dc594c65d01b0513d17230730304 100644 (file)
@@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci);
 static inline void ci_otg_queue_work(struct ci_hdrc *ci)
 {
        disable_irq_nosync(ci->irq);
-       queue_work(ci->wq, &ci->work);
+       if (queue_work(ci->wq, &ci->work) == false)
+               enable_irq(ci->irq);
 }
 
 #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */