Commit 8b97d73c authored by Loic Poulain's avatar Loic Poulain Committed by Peter Chen

usb: chipidea: Prevent unbalanced IRQ disable

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: be6b0c1b ("usb: chipidea: using one inline function to cover queue work operations")
Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent 1fa9697c
...@@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci); ...@@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci);
static inline void ci_otg_queue_work(struct ci_hdrc *ci) static inline void ci_otg_queue_work(struct ci_hdrc *ci)
{ {
disable_irq_nosync(ci->irq); 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 */ #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment