From: sashiko-bot@kernel.org
To: "Ming Qian" <ming.qian@oss.nxp.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH] pmdomain: imx8m-blk-ctrl: Serialize power on/off across sibling domains
Date: Tue, 15 Sep 2026 10:20:27 +0000 [thread overview]
Message-ID: <20260915102028.2CFFD1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915-imx8mp-blk-ctrl-v1-1-b3b4e6e7e676@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] cleanup: mixing goto-based error handling with guard()
--
commit f6256896fe23aa6a79fb250eed1b63a79f67a19e
Author: Ming Qian <ming.qian@oss.nxp.com>
pmdomain: imx8m-blk-ctrl: Serialize power on/off across sibling domains
This commit adds a per-blk-ctrl mutex to serialize the blk-ctrl register
and reset sequence across sibling domains in the i.MX8MP VPU. This fixes
a defect where concurrent power transitions disturb shared clock timings,
leaving a VPU stuck in reset.
> diff --git a/drivers/pmdomain/imx/imx8m-blk-ctrl.c b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
> index 479789009c7f4..f8105e87ea3c0 100644
> --- a/drivers/pmdomain/imx/imx8m-blk-ctrl.c
> +++ b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
> @@ -98,6 +105,8 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd)
> struct imx8m_blk_ctrl *bc = domain->bc;
> int ret;
>
> + guard(mutex)(&bc->power_lock);
> +
[Severity: Low]
Does this mix the guard macro with legacy goto-based error handling in
imx8m_blk_ctrl_power_on()?
Later in this function, there are goto statements for error handling:
ret = clk_bulk_prepare_enable(data->num_clks, domain->clks);
if (ret) {
...
goto bus_put;
}
According to the cleanup subsystem guidelines (include/linux/cleanup.h),
using goto and scope-based cleanup helpers shouldn't be mixed in the same
function.
While this specific instance doesn't introduce a functional runtime bug right
now (since there are no other scope-based variables causing LIFO ordering
conflicts), it violates the subsystem policy and might lead to confusing
ownership semantics or regressions during future refactoring.
Could this function be fully converted to scope-based cleanup, or should it
stick entirely to standard lock/unlock calls with goto-based cleanup?
> /* make sure bus domain is awake */
> ret = pm_runtime_get_sync(bc->bus_power_dev);
> if (ret < 0) {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915-imx8mp-blk-ctrl-v1-1-b3b4e6e7e676@oss.nxp.com?part=1
next prev parent reply other threads:[~2026-09-15 10:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 10:09 [PATCH] pmdomain: imx8m-blk-ctrl: Serialize power on/off across sibling domains Ming Qian
2026-09-15 10:20 ` sashiko-bot [this message]
2026-09-15 14:13 ` Frank Li
2026-09-16 3:06 ` Ming Qian(OSS)
2026-09-16 19:31 ` 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=20260915102028.2CFFD1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=ming.qian@oss.nxp.com \
--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