Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Philippe Schenker <philippe.schenker@toradex.com>
To: linux-usb@vger.kernel.org, Peter Chen <Peter.Chen@nxp.com>
Cc: Stefan Agner <stefan.agner@toradex.com>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Philippe Schenker <philippe.schenker@toradex.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] usb: chipidea: fix ci_irq for role-switching use-case
Date: Fri, 26 Jun 2020 13:03:11 +0200
Message-ID: <20200626110311.221596-1-philippe.schenker@toradex.com> (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 <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


             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20200626110311.221596-1-philippe.schenker@toradex.com \
    --to=philippe.schenker@toradex.com \
    --cc=Peter.Chen@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=stefan.agner@toradex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 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/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git