linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: chipidea: fix ci_irq for role-switching use-case
@ 2020-06-26 11:03 Philippe Schenker
  2020-06-29  7:26 ` Peter Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Philippe Schenker @ 2020-06-26 11:03 UTC (permalink / raw)
  To: linux-usb, Peter Chen
  Cc: Stefan Agner, Marcel Ziswiler, Philippe Schenker,
	Greg Kroah-Hartman, linux-kernel

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 <philippe.schenker@toradex.com>

---

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.

Thanks,
Philippe

---

 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)
 		disable_irq_nosync(irq);
 		ci->wakeup_int = true;
 		pm_runtime_get(ci->dev);
-		return IRQ_HANDLED;
+		ret = IRQ_HANDLED;
 	}
 
 	if (ci->is_otg) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-01 10:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 11:03 [PATCH] usb: chipidea: fix ci_irq for role-switching use-case Philippe Schenker
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).