Re: [PATCH v3 3/4] irqchip/imx-irqsteer: Mask all interrupts in probe() and remove()

[email protected]
Newsgroups dev.linux.lists.imx
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing `pm_runtime_get_sync()` in `imx_irqsteer_remove()` causes a fatal bus error on device unbind.
--

--- Patch [3]: [PATCH v3 3/4] irqchip/imx-irqsteer: Mask all interrupts in probe() and remove() ---
commit cdd5c75cd302eeb1d325e53989eb54042df373f6
Author: Zhipeng Wang <[email protected]>

irqchip/imx-irqsteer: Mask all interrupts in probe() and remove()

This commit masks all interrupts in probe before wiring up chained handlers,
and again in remove to quiesce the hardware for the next probe. This is
intended to prevent interrupt storms on module reload.

> diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
> index 4a2fe8ba97f50..0c9c99f1141a9 100644
> --- a/drivers/irqchip/irq-imx-irqsteer.c
> +++ b/drivers/irqchip/irq-imx-irqsteer.c
[ ... ]
> @@ -279,6 +283,11 @@ static void imx_irqsteer_remove(struct platform_device *pdev)
>  	struct irqsteer_data *irqsteer_data = platform_get_drvdata(pdev);
>  	int hwirq, i;
>  
> +	/* mask all interrupts so a stale line cannot storm on the next probe */
> +	for (i = 0; i < irqsteer_data->reg_num; i++)
> +		writel_relaxed(0, irqsteer_data->regs +
> +			       CHANMASK(i, irqsteer_data->reg_num));
[Severity: High]
Will this hardware register access cause a fatal bus error during device unbind?

During driver unbind (via module unload or sysfs), the driver core explicitly
calls pm_runtime_put_sync() before calling the driver's remove callback. This
drops the runtime PM usage count and synchronously suspends the device, which
disables the device's clock.

If the hardware is already unclocked, does calling writel_relaxed() on the
CHANMASK hardware registers without first waking the device up via
pm_runtime_get_sync() trigger a synchronous external abort on i.MX platforms?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.