Re: [PATCH v2] i3c: dw: rename "pclk" to "apb" to match dt-binding

[email protected]
Newsgroups org.infradead.lists.linux-i3c
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing error check for platform_get_irq() breaks probe deferral.
--

--- Patch [1]: [PATCH v2] i3c: dw: rename "pclk" to "apb" to match dt-binding ---
commit 342a3504d5ec0fb05c08b9de5076fc569bcdc43b
Author: Jisheng Zhang <[email protected]>

i3c: dw: rename "pclk" to "apb" to match dt-binding

Change clock name "pclk" to "apb" to match dt-binding doc. No upstream
device tree sources currently use the "pclk" clock name, so no any
backward compatibility issues.

> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 2f8c0c4683e06..0625587f15274 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1579,7 +1579,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
>  	if (IS_ERR(master->core_clk))
>  		return PTR_ERR(master->core_clk);
>  
> -	master->pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
> +	master->pclk = devm_clk_get_optional_enabled(&pdev->dev, "apb");
>  	if (IS_ERR(master->pclk))
>  		return PTR_ERR(master->pclk);

[ ... ]

>  	writel(INTR_ALL, master->regs + INTR_STATUS);
>  	irq = platform_get_irq(pdev, 0);
>  	ret = devm_request_irq(&pdev->dev, irq,
>  			       dw_i3c_master_irq_handler, 0,
>  			       dev_name(&pdev->dev), master);

[Severity: High]
This isn't a bug introduced by this patch, but is it possible for
platform_get_irq() to return a negative error code like -EPROBE_DEFER here?

If irq is negative, passing it to devm_request_irq() without validation
causes it to fail with -EINVAL, overriding the original -EPROBE_DEFER error
code. Could this break the probe deferral mechanism for dw_i3c_common_probe()
in drivers/i3c/master/dw-i3c-master.c by preventing it from retrying when the
IRQ controller is ready?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
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.