Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i3c: dw: fix APB clock name
@ 2026-08-03 14:02 Jisheng Zhang
  2026-08-03 14:32 ` sashiko-bot
  2026-08-05 20:20 ` Frank Li
  0 siblings, 2 replies; 3+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:02 UTC (permalink / raw)
  To: Alexandre Belloni, Frank Li, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-i3c, linux-kernel, devicetree

The dt-binding doc says the APB clock name is "apb", but the code uses
"pclk". Since the dt-binding is an ABI, we can only fix this mismatch
by fixing the code.

Fixes: a0d48ebf39ce ("i3c: dw: Add optional apb clock")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/i3c/master/dw-i3c-master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 2f8c0c4683e0..0625587f1527 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);
 
-- 
2.53.0


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: dw: fix APB clock name
  2026-08-03 14:02 [PATCH] i3c: dw: fix APB clock name Jisheng Zhang
@ 2026-08-03 14:32 ` sashiko-bot
  2026-08-05 20:20 ` Frank Li
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-08-03 14:32 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Alexandre Belloni, conor+dt, linux-i3c, Frank.Li, robh,
	devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the return value of `dw_i3c_master_enable_clks()` is ignored in `dw_i3c_master_runtime_resume()`.
--

--- Patch [1]: [PATCH] i3c: dw: fix APB clock name ---
commit 686892a7f9278958827b79c6f3b4b10f19a623b2
Author: Jisheng Zhang <jszhang@kernel.org>

i3c: dw: fix APB clock name

This commit fixes a mismatch between the APB clock name in the code and the
device tree bindings. It changes the clock name requested by the driver from
pclk to apb to match the ABI.

> 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");

[Severity: High]
This isn't a bug introduced by this patch, but since we are modifying clock
handling here, does dw_i3c_master_runtime_resume() need to check the return
value of dw_i3c_master_enable_clks()?

In drivers/i3c/master/dw-i3c-master.c:dw_i3c_master_runtime_resume():

	pinctrl_pm_select_default_state(dev);
	dw_i3c_master_enable_clks(master);
	reset_control_deassert(master->core_rst);

If the clock framework fails to enable the clocks during runtime resume,
dw_i3c_master_enable_clks() will return a negative error code. This is
currently ignored, and the driver proceeds to deassert the reset and access
hardware registers. 

Can this lead to an unrecoverable bus fault or system crash if the registers
are accessed without an active clock?

>  	if (IS_ERR(master->pclk))
>  		return PTR_ERR(master->pclk);
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260803140224.12648-1-jszhang@kernel.org?part=1

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: dw: fix APB clock name
  2026-08-03 14:02 [PATCH] i3c: dw: fix APB clock name Jisheng Zhang
  2026-08-03 14:32 ` sashiko-bot
@ 2026-08-05 20:20 ` Frank Li
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-08-05 20:20 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Alexandre Belloni, Frank Li, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-i3c, linux-kernel, devicetree

On Mon, Aug 03, 2026 at 10:02:24PM +0800, Jisheng Zhang wrote:
> The dt-binding doc says the APB clock name is "apb", but the code uses
> "pclk". Since the dt-binding is an ABI, we can only fix this mismatch
> by fixing the code.

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.

Not sure what happen when apply patch a0d48ebf39ce. Anyways, thanks for fix
it.

Frank
>
> Fixes: a0d48ebf39ce ("i3c: dw: Add optional apb clock")
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/i3c/master/dw-i3c-master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 2f8c0c4683e0..0625587f1527 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);
>
> --
> 2.53.0
>

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

end of thread, other threads:[~2026-08-05 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 14:02 [PATCH] i3c: dw: fix APB clock name Jisheng Zhang
2026-08-03 14:32 ` sashiko-bot
2026-08-05 20:20 ` Frank Li

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