Thread (19 messages) 19 messages, 5 authors, 2026-09-13

Re: [PATCH v5 3/7] phy: cpcap-usb: fix IRQ teardown race

From: Manivannan Sadhasivam <mani@kernel.org>
Date: 2026-09-09 15:32:18
Also in: linux-gpio, linux-omap, linux-phy, lkml

On Sat, Jul 11, 2026 at 11:42:06PM +0300, Ivaylo Dimitrov wrote:
there is a race between IRQ handler and remove:

IRQ thread:
    ddata->active == 1

remove():
    ddata->active = 0
    cancel_delayed_work_sync()

IRQ thread:
    schedule_delayed_work()

The IRQ handler can therefore queue detect work after it has been canceled
during remove(). Free the IRQ handlers before canceling detect work to
prevent new work from being scheduled during teardown.

Reported by Sashiko
Add a proper tag.
quoted hunk ↗ jump to hunk
Signed-off-by: Ivaylo Dimitrov <redacted>
---
 drivers/phy/motorola/phy-cpcap-usb.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
index 7cb020dd3423..741145c89e5b 100644
--- a/drivers/phy/motorola/phy-cpcap-usb.c
+++ b/drivers/phy/motorola/phy-cpcap-usb.c
@@ -393,6 +393,19 @@ static int cpcap_usb_init_interrupts(struct platform_device *pdev,
 	return 0;
 }
 
+static void cpcap_usb_fini_interrupts(struct platform_device *pdev,
s/fini/free

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help