From: sashiko-bot@kernel.org
To: "Jisheng Zhang" <jszhang@kernel.org>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/3] i3c: dw: Add apb reset support
Date: Mon, 11 May 2026 23:13:32 +0000 [thread overview]
Message-ID: <20260511231332.D4185C2BCFA@smtp.kernel.org> (raw)
In-Reply-To: <20260511031945.3228-4-jszhang@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The assertion and deassertion ordering of `core_rst` and `apb_rst` violates correct bus-peripheral hardware sequencing and LIFO resource management symmetry.
--
commit 9be063129d3014c8590f046b253447e4090e7f37
Author: Jisheng Zhang <jszhang@kernel.org>
i3c: dw: Add apb reset support
This commit adds support for the optional APB reset in the DesignWare I3C
master driver. The reset is acquired during probe and asserted or
deasserted during runtime PM suspend and resume cycles.
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1596,6 +1596,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
> if (IS_ERR(master->core_rst))
> return PTR_ERR(master->core_rst);
>
> + master->apb_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
> + "apb_rst");
> + if (IS_ERR(master->apb_rst))
> + return PTR_ERR(master->apb_rst);
> +
Should apb_rst be requested before core_rst?
Since devm handles cleanup in reverse allocation order, requesting core_rst
first means apb_rst will be asserted before core_rst during driver unload
or probe failure. This would shut down the bus interface while the IP core
is still active, contradicting the safe shutdown sequence correctly
implemented in dw_i3c_master_runtime_suspend().
Additionally, since devm_reset_control_get_optional_exclusive_deasserted()
automatically deasserts the reset, this ordering brings the IP core out of
reset before the APB bus interface is active.
[ ... ]
> @@ -1796,6 +1802,7 @@ static int __maybe_unused dw_i3c_master_runtime_resume(struct device *dev)
> pinctrl_pm_select_default_state(dev);
> dw_i3c_master_enable_clks(master);
> reset_control_deassert(master->core_rst);
> + reset_control_deassert(master->apb_rst);
Is this deassertion order correct?
Deasserting core_rst before apb_rst brings the IP core out of reset before
its APB bus interface is active. Could this cause the IP to run while
disconnected from the bus, leading to unpredictable states?
Would it be safer to deassert apb_rst before core_rst?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260511031945.3228-1-jszhang@kernel.org?part=3
next prev parent reply other threads:[~2026-05-11 23:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 3:19 [PATCH v2 0/3] i3c: dw: Add apb reset support Jisheng Zhang
2026-05-11 3:19 ` [PATCH v2 1/3] dt-bindings: i3c: dw: Describe core reset Jisheng Zhang
2026-05-11 19:27 ` Frank Li
2026-05-11 3:19 ` [PATCH v2 2/3] dt-bindings: i3c: dw: Add apb reset Jisheng Zhang
2026-05-11 16:02 ` Conor Dooley
2026-05-11 23:00 ` sashiko-bot
2026-05-12 16:44 ` Conor Dooley
2026-05-11 3:19 ` [PATCH v2 3/3] i3c: dw: Add apb reset support Jisheng Zhang
2026-05-11 23:13 ` sashiko-bot [this message]
2026-05-11 19:04 ` [EXT] [PATCH v2 0/3] " 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=20260511231332.D4185C2BCFA@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jszhang@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko@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