summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jun <jun.li@freescale.com>2015-06-23 10:46:44 +0800
committerLi Jun <jun.li@freescale.com>2015-07-22 10:22:07 +0800
commitb924c9ee2a93f67b38b177d517415b73e8567c56 (patch)
tree97f778b391e5041c3bd9ae5cf27abe8b758a6bda
parent207c62380be1879288ab018af888bb2b5e346d3f (diff)
MLK-11147 usb: chipidea: otg: keep irq enabled if otg work had been queued
If the otg work had been queued, current code will disable irq again but the otg work will be done only once, so the irq enable and disable cannot be balanced, this patch is to fix this. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 0d5c0888eaec17289e40968d7d15b92b781ed34f)
-rw-r--r--drivers/usb/chipidea/otg.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
index 43296cde913d..95fa6c2b675a 100644
--- a/drivers/usb/chipidea/otg.h
+++ b/drivers/usb/chipidea/otg.h
@@ -21,11 +21,13 @@ void ci_handle_id_switch(struct ci_hdrc *ci);
void ci_handle_vbus_connected(struct ci_hdrc *ci);
static inline void ci_otg_queue_work(struct ci_hdrc *ci)
{
- WARN_ON(!ci->wq);
-
- disable_irq_nosync(ci->irq);
- if (ci->wq)
- queue_work(ci->wq, &ci->work);
+ if (ci->wq) {
+ disable_irq_nosync(ci->irq);
+ if (!queue_work(ci->wq, &ci->work))
+ enable_irq(ci->irq);
+ } else {
+ WARN_ON(!ci->wq);
+ }
}
#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */