Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: stusb160x: disable the interrupt before tearing down
@ 2026-11-12  6:56 Myeonghun Pak
  2026-11-12  7:04 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-11-12  6:56 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Amelie Delaunay, linux-usb, linux-kernel,
	Ijae Kim, stable

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.

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


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

end of thread, other threads:[~2026-11-12  7:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  6:56 [PATCH] usb: typec: stusb160x: disable the interrupt before tearing down Myeonghun Pak
2026-11-12  7:04 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox