Commit 3d5245b0a71b1bec488d349bdaa098ae59a6ab90

Authored by Li Jun
1 parent e403b318e3

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>

Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff

drivers/usb/chipidea/core.c
... ... @@ -523,6 +523,13 @@
523 523 u32 otgsc = 0;
524 524  
525 525 if (ci->in_lpm) {
  526 + /*
  527 + * If we already have a wakeup irq pending there,
  528 + * let's just return to wait resume finished firstly.
  529 + */
  530 + if (ci->wakeup_int)
  531 + return IRQ_HANDLED;
  532 +
526 533 disable_irq_nosync(irq);
527 534 ci->wakeup_int = true;
528 535 pm_runtime_get(ci->dev);