Linux-USB Archive on
 help / color / Atom feed
From: Philippe Schenker <>
To:, Peter Chen <>
Cc: Stefan Agner <>,
	Marcel Ziswiler <>,
	Philippe Schenker <>,
	Greg Kroah-Hartman <>,
Subject: [PATCH] usb: chipidea: fix ci_irq for role-switching use-case
Date: Fri, 26 Jun 2020 13:03:11 +0200
Message-ID: <> (raw)

If the hardware is in low-power-mode and one plugs in device or host
it did not switch the mode due to the early exit out of the interrupt.

This patch fixes that behaviour and lets the rest of the code check if
something has to be done. If nothing has to be done the same return
value gets returned as before.

Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
Signed-off-by: Philippe Schenker <>


Hi Peter

During my investigation I found a bug in ci_irq. I would appreciate
if you could review this. From what I see this patch should be save to apply.

This patch does not solve all of our issues. When I have RUNTIME_PM
enabled on imx6ull or imx7. RNDIS still does not come up. So there
has to be another bug hiding somewhere in the Runtime PM code to prevent
RNDIS from working properly. I quickly looked through your patches
that added this stuff back in 2015 but couldn't spot anything related to
usb gadget-mode.

If you right away know where the problem could be hiding itself,
I would appreciate a hint.



 drivers/usb/chipidea/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 9a7c53d09ab4..5159420a23a4 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -518,7 +518,7 @@ static irqreturn_t ci_irq(int irq, void *data)
 		ci->wakeup_int = true;
-		return IRQ_HANDLED;
+		ret = IRQ_HANDLED;
 	if (ci->is_otg) {

             reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 11:03 Philippe Schenker [this message]
2020-06-29  7:26 ` Peter Chen
2020-06-29 10:04   ` Philippe Schenker
2020-06-30  0:43     ` Peter Chen
2020-06-30 11:59       ` Philippe Schenker
2020-07-01  2:52         ` Peter Chen
2020-07-01  8:32           ` Philippe Schenker
2020-07-01  9:02             ` Peter Chen
2020-07-01 10:52               ` Philippe Schenker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-USB Archive on

Archives are clonable:
	git clone --mirror linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ \
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone