summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2017-07-19 01:18:19 +0800
committerLi Jun <jun.li@nxp.com>2017-07-20 00:01:08 +0800
commit3d5245b0a71b1bec488d349bdaa098ae59a6ab90 (patch)
tree7f024978e88cb5e51e4a6b3ea1d338f54fdf7790 /drivers
parente403b318e3140495599331d669a67afabb9c5e88 (diff)
MLK-15984 usb: chipidea: wait controller resume finished for wakeup irq
After the chipidea driver introduce extcon for id and vbus, it's able to wakeup from another irq source, in case the system with extcon ID cable, wakeup from usb ID cable and device removal, the usb device disconnect irq may come firstly before the extcon notifier while system resume, so we will get 2 "wakeup" irq, one for usb device disconnect; and one for extcon ID cable change(real wakeup event), current driver treat them as 2 successive wakeup irq so can't handle it correctly, then finially the usb irq can't be enabled. This patch adds a check to bypass further usb events before controller resume finished to fix it. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 0fb156d82bfd..08a468683e0a 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -523,6 +523,13 @@ static irqreturn_t ci_irq(int irq, void *data)
u32 otgsc = 0;
if (ci->in_lpm) {
+ /*
+ * If we already have a wakeup irq pending there,
+ * let's just return to wait resume finished firstly.
+ */
+ if (ci->wakeup_int)
+ return IRQ_HANDLED;
+
disable_irq_nosync(irq);
ci->wakeup_int = true;
pm_runtime_get(ci->dev);