summaryrefslogtreecommitdiff
path: root/drivers
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-02 10:30:11 +0800
commit0d5c0888eaec17289e40968d7d15b92b781ed34f (patch)
tree36104bf6601a592dd8959eeeb58ebf8a8fa5c33e /drivers
parenta6e4889c9b665de82aea1593285d5dece5e40941 (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>
Diffstat (limited to 'drivers')
-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 */