All of lore.kernel.org
 help / color / mirror / Atom feed
* [v3,3/6] usb: chipidea: Prevent unbalanced IRQ disable
@ 2018-09-04 15:18 Loic Poulain
  0 siblings, 0 replies; only message in thread
From: Loic Poulain @ 2018-09-04 15:18 UTC (permalink / raw)
  To: Peter.Chen
  Cc: linux-usb, linux-arm-msm, david.brown, robh+dt, bjorn.andersson,
	andy.gross, andy.shevchenko, Loic Poulain

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>
---
 v2: v3: no change

 drivers/usb/chipidea/otg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
index 7e7428e..4f8b817 100644
--- a/drivers/usb/chipidea/otg.h
+++ b/drivers/usb/chipidea/otg.h
@@ -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 */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-04 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 15:18 [v3,3/6] usb: chipidea: Prevent unbalanced IRQ disable Loic Poulain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.