From: Peter Chen <peter.chen@kernel.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: gregkh@linuxfoundation.org, shawnguo@kernel.org,
s.hauer@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
luca.ceresoli@bootlin.com, jun.li@nxp.com,
linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/3] usb: chipidea: wait controller resume finished for wakeup irq
Date: Fri, 22 Dec 2023 11:41:55 +0800 [thread overview]
Message-ID: <20231222034155.GB1951375@nchen-desktop> (raw)
In-Reply-To: <20231218061420.3460145-2-xu.yang_2@nxp.com>
On 23-12-18 14:14:19, Xu Yang wrote:
> 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
> finally the usb irq can't be enabled. This patch adds a check to bypass
> further usb events before controller resume finished to fix it.
>
> Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
> cc: <stable@vger.kernel.org>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> Signed-off-by: Li Jun <jun.li@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
>
> ---
> Changes in v2:
> - no changes
> ---
> drivers/usb/chipidea/core.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 7ac39a281b8c..85e9c3ab66e9 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -523,6 +523,13 @@ static irqreturn_t ci_irq_handler(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);
> --
> 2.34.1
>
--
Thanks,
Peter Chen
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-12-22 3:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 6:14 [PATCH v2 1/3] usb: chipidea: ci_hdrc_imx: add wakeup clock and keep it always on Xu Yang
2023-12-18 6:14 ` [PATCH v2 2/3] usb: chipidea: wait controller resume finished for wakeup irq Xu Yang
2023-12-22 3:41 ` Peter Chen [this message]
2023-12-18 6:14 ` [PATCH v2 3/3] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() Xu Yang
2023-12-22 9:28 ` Peter Chen
2023-12-22 3:40 ` [PATCH v2 1/3] usb: chipidea: ci_hdrc_imx: add wakeup clock and keep it always on Peter Chen
2023-12-22 8:24 ` [EXT] " Xu Yang
2023-12-22 9:25 ` Peter Chen
2023-12-22 12:26 ` Stefan Wahren
2023-12-25 2:20 ` [EXT] " Xu Yang
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=20231222034155.GB1951375@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jun.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=xu.yang_2@nxp.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox