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

Manivannan Sadhasivam mani at kernel.org
Wed Sep 9 08:32:09 PDT 2026


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.

> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75 at gmail.com>
> ---
>  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

-- 
மணிவண்ணன் சதாசிவம்



More information about the linux-phy mailing list