From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Amelie Delaunay <amelie.delaunay@foss.st.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Ijae Kim <ae878000@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] usb: typec: stusb160x: disable the interrupt before tearing down
Date: Tue, 17 Nov 2026 11:22:24 +0100 [thread overview]
Message-ID: <avwq4Iau0iA_TmQ7@black.igk.intel.com> (raw)
In-Reply-To: <20261112065620.34269-1-mhun512@gmail.com>
On Thu, Nov 12, 2026 at 01:56:20AM -0500, Myeonghun Pak wrote:
> The devm-managed IRQ remains active while stusb160x_remove() tears down
> the partner, VBUS, role switch and Type-C port. An attach or detach event
> can race with partner removal or access the port and role switch after
> they are released.
>
> Disable and synchronize the IRQ at the start of remove(), before any of
> these resources are torn down.
>
> Found by a static analysis tool under development.
> Not tested on hardware.
The same question here. Why still use the devm_* to request the irq?
Thanks,
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Cc: stable@vger.kernel.org
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>
> drivers/usb/typec/stusb160x.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index a2ec0565bd85..ec2f4d7f7ed3 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -801,6 +801,9 @@ static void stusb160x_remove(struct i2c_client *client)
> {
> struct stusb160x *chip = i2c_get_clientdata(client);
>
> + if (client->irq)
> + disable_irq(client->irq);
> +
> if (chip->partner) {
> typec_unregister_partner(chip->partner);
> chip->partner = NULL;
>
> base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
> --
> 2.43.0
--
heikki
prev parent reply other threads:[~2026-11-17 10:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 6:56 [PATCH] usb: typec: stusb160x: disable the interrupt before tearing down Myeonghun Pak
2026-11-12 7:04 ` sashiko-bot
2026-11-17 10:22 ` Heikki Krogerus [this message]
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=avwq4Iau0iA_TmQ7@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=ae878000@gmail.com \
--cc=amelie.delaunay@foss.st.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mhun512@gmail.com \
--cc=stable@vger.kernel.org \
/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