From: sashiko-bot@kernel.org
To: "Graham O'Connor" <graham.oconnor@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 1/6] soc: qcom: rpmh-rsc: Skip TCS init when RSC is managed by firmware
Date: Fri, 22 May 2026 06:48:10 +0000 [thread overview]
Message-ID: <20260522064810.A37981F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260522060645.4399-2-graham.oconnor@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] Returning early from the probe function bypasses the initialization of critical locks, waitqueues, and list heads, leading to kernel panics when RPMh APIs are invoked.
- [High] The early return completely skips `devm_of_platform_populate()`, preventing essential child devices from probing and permanently breaking the system boot process.
--
commit 42c9f85b1ee98ffd687b17f97edf46cb0e222ced
Author: Graham O'Connor <graham.oconnor@gmail.com>
soc: qcom: rpmh-rsc: Skip TCS init when RSC is managed by firmware
This commit skips TCS initialization in the RPMh RSC driver when the hardware
solver is already active. This prevents security violations and system resets
caused by reinitializing a controller that is actively managed by firmware.
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
[ ... ]
> @@ -1074,6 +1074,20 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
> else
> drv->regs = rpmh_rsc_reg_offset_ver_2_7;
>
> + /*
> + * On some platforms the RSC is already managed by the firmware
> + * when the kernel boots. Calling rpmh_probe_tcs_config() in this
> + * state would reinitialize the controller and cause a security
> + * violation. Skip TCS initialization if the hardware solver is
> + * already active.
> + */
> + if (readl_relaxed(drv->base + drv->regs[DRV_SOLVER_CONFIG]) &
> + (DRV_HW_SOLVER_MASK << DRV_HW_SOLVER_SHIFT)) {
> + dev_dbg(&pdev->dev, "RSC already managed by firmware, skipping TCS init\n");
> + platform_set_drvdata(pdev, drv);
> + return 0;
[Severity: Critical]
Since drv is allocated with devm_kzalloc(), bypassing the rest of the probe
function leaves essential software structures uninitialized.
Specifically, spin_lock_init(&drv->client.cache_lock),
init_waitqueue_head(&drv->tcs_wait), and INIT_LIST_HEAD(&drv->client.cache)
are skipped.
Because platform_set_drvdata(pdev, drv) exposes this controller to other
drivers, will standard RPMh APIs like rpmh_write() crash with a NULL pointer
dereference when attempting to acquire the uninitialized spinlock or add to
the zero-initialized list head?
[Severity: High]
Does this early return also skip the instantiation of child devices?
The rpmh_rsc_probe() function normally relies on devm_of_platform_populate()
at the end of the function to instantiate its children. By returning early,
crucial child devices such as the clock controller (rpmhcc), power domain
controller (rpmhpd), and interconnect voters (bcm-voter) are never created.
Will this leave downstream peripheral drivers that depend on these clocks
or regulators permanently stuck in an -EPROBE_DEFER state, breaking the
system boot process?
> + }
> +
> ret = rpmh_probe_tcs_config(pdev, drv);
> if (ret)
> return ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260522060645.4399-1-graham.oconnor@gmail.com?part=1
next prev parent reply other threads:[~2026-05-22 6:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 6:06 [PATCH 0/6] arm64: qcom: Enable additional hardware on Radxa Dragon Q6A Graham O'Connor
2026-05-22 6:06 ` [PATCH 1/6] soc: qcom: rpmh-rsc: Skip TCS init when RSC is managed by firmware Graham O'Connor
2026-05-22 6:48 ` sashiko-bot [this message]
2026-05-22 6:06 ` [PATCH 2/6] firmware: qcom: scm: Allow EFI variable access on Radxa Dragon Q6A Graham O'Connor
2026-05-22 6:06 ` [PATCH 3/6] drm/msm/dp: Limit voltage swing level to 2 for RA620 bridge Graham O'Connor
2026-05-22 6:55 ` sashiko-bot
2026-05-22 9:28 ` Konrad Dybcio
2026-05-22 6:06 ` [PATCH 4/6] arm64: dts: qcom: qcs6490-radxa-dragon-q6a: Add regulator supplies and disable EUD Graham O'Connor
2026-05-22 7:27 ` sashiko-bot
2026-05-22 6:06 ` [PATCH 5/6] arm64: dts: qcom: qcs6490-radxa-dragon-q6a: Enable GPU and display pipeline Graham O'Connor
2026-05-22 6:44 ` Neil Armstrong
2026-05-22 7:52 ` sashiko-bot
2026-05-22 6:06 ` [PATCH 6/6] arm64: dts: qcom: qcs6490-radxa-dragon-q6a: Enable USB3 SuperSpeed Graham O'Connor
2026-05-22 6:44 ` Neil Armstrong
2026-05-22 10:13 ` [PATCH 0/6] arm64: qcom: Enable additional hardware on Radxa Dragon Q6A Graham O'Connor
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=20260522064810.A37981F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=graham.oconnor@gmail.com \
--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