Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jisheng Zhang" <jszhang@kernel.org>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	conor+dt@kernel.org, linux-i3c@lists.infradead.org,
	Frank.Li@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH] i3c: dw: fix APB clock name
Date: Mon, 03 Aug 2026 14:32:41 +0000	[thread overview]
Message-ID: <20260803143244.BA0651F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803140224.12648-1-jszhang@kernel.org>

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

  reply	other threads:[~2026-08-03 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 14:02 [PATCH] i3c: dw: fix APB clock name Jisheng Zhang
2026-08-03 14:32 ` sashiko-bot [this message]
2026-08-05 20:20 ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260803143244.BA0651F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jszhang@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox