From: sashiko-bot@kernel.org
To: "Sneh Mankad" <sneh.mankad@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 6/7] arm64: dts: qcom: agatti: Do not mark MPM as power domain
Date: Mon, 13 Jul 2026 10:39:56 +0000 [thread overview]
Message-ID: <20260713103957.4C0C61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260713-b4-shikra_lpm_addition-v1-6-3d858df2cbbf@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing check for KTIME_MAX and expired timers causes 64-bit integer overflow, resulting in an unpredictable hardware wakeup time.
- [High] Mailbox notification is sent to the RPM processor before the timer registers are updated, causing a race where RPM reads stale timer values.
--
--- Patch [6]: [PATCH 6/7] arm64: dts: qcom: agatti: Do not mark MPM as power domain ---
commit 7c3965f0765f0a48723f4b17bac82d687c8614cc
Author: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
arm64: dts: qcom: agatti: Do not mark MPM as power domain
Do not mark MPM device as power domain since it leads to idle-states init
failure because of probe dependencies. CPU cluster power domain node is kept
disabled and hence CPU cluster will never power collapse. Do not register
MPM under it in this case.
> diff --git a/arch/arm64/boot/dts/qcom/agatti.dtsi b/arch/arm64/boot/dts/qcom/agatti.dtsi
> index f0b6ae9b81528..ddb038b3bbbc4 100644
> --- a/arch/arm64/boot/dts/qcom/agatti.dtsi
> +++ b/arch/arm64/boot/dts/qcom/agatti.dtsi
> @@ -205,7 +205,6 @@ cpu_pd3: power-domain-cpu3 {
>
> cluster_pd: power-domain-cpu-cluster {
> #power-domain-cells = <0>;
> - power-domains = <&mpm>;
> domain-idle-states = <&cluster_sleep>;
> };
> };
[Severity: High]
Does removing the MPM power domain mapping cause issues with the timer
values?
When no hrtimers are pending, dev_pm_genpd_get_next_hrtimer() returns
KTIME_MAX. Subtracting 'now' leaves a huge positive value, which when
converted to microseconds and multiplied by 0x10C7UL overflows the 64-bit
boundary.
Similarly, if a timer has already expired, the negative difference
becomes a huge positive value when implicitly cast to u64 wakeup_us, leading
to overflow.
Could this happen here in mpm_write_next_wakeup() within
drivers/irqchip/irq-qcom-mpm.c:
wakeup = dev_pm_genpd_get_next_hrtimer(priv->dev);
/* Find the relative wakeup in kernel time scale */
now = ktime_get();
wakeup = ktime_sub(wakeup, now);
wakeup_us = ktime_to_us(wakeup);
/* Convert the wakeup to arch timer scale */
wakeup_cycles = USECS_TO_CYCLES(wakeup_us);
and cause random timer values to be programmed into the MPM hardware?
[ ... ]
> @@ -281,7 +280,6 @@ mpm: interrupt-controller {
> mboxes = <&apcs_glb 1>;
> interrupt-controller;
> #interrupt-cells = <2>;
> - #power-domain-cells = <0>;
> interrupt-parent = <&intc>;
> qcom,mpm-pin-count = <96>;
> qcom,mpm-pin-map = <2 275>, /* TSENS0 uplow */
[Severity: High]
Does this change expose a race condition with the RPM processor?
The AP signals the RPM processor to configure hardware state from the shared
vMPM SRAM before actually writing the new timer wakeup values to the SRAM.
Since the RPM is an independent processor, it is highly likely to read the
old, stale timer values.
Could this happen here in handle_rpm_notification() within
drivers/irqchip/irq-qcom-mpm.c:
/* Notify RPM to write vMPM into HW */
ret = mbox_send_message(priv->mbox_chan, NULL);
if (ret < 0)
return ret;
mpm_write_next_wakeup(priv);
and cause the hardware to be programmed with the incorrect wakeup time?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260713-b4-shikra_lpm_addition-v1-0-3d858df2cbbf@oss.qualcomm.com?part=6
next prev parent reply other threads:[~2026-07-13 10:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 10:25 [PATCH 0/7] Register MPM under CPU cluster power domain to manage RPM notification Sneh Mankad
2026-07-13 10:25 ` [PATCH 1/7] dt-bindings: interrupt-controller: mpm: Document power-domains property Sneh Mankad
2026-07-13 10:36 ` sashiko-bot
2026-07-13 11:26 ` Konrad Dybcio
2026-07-13 15:11 ` Marc Zyngier
2026-07-13 10:25 ` [PATCH 2/7] irqchip/irq-qcom-mpm: Register MPM under CPU cluster power domain Sneh Mankad
2026-07-13 10:41 ` sashiko-bot
2026-07-13 10:25 ` [PATCH 3/7] irqchip/irq-qcom-mpm: Prepare common access path for timer and pin regs Sneh Mankad
2026-07-13 10:39 ` sashiko-bot
2026-07-13 10:25 ` [PATCH 4/7] irqchip/irq-qcom-mpm: Program wakeup timer when CPU cluster goes to LPM Sneh Mankad
2026-07-13 10:38 ` sashiko-bot
2026-07-13 15:18 ` Marc Zyngier
2026-07-13 10:25 ` [PATCH 5/7] arm64: dts: qcom: sm6375: Make MPM device as part of CPU cluster domain Sneh Mankad
2026-07-13 10:40 ` sashiko-bot
2026-07-13 10:25 ` [PATCH 6/7] arm64: dts: qcom: agatti: Do not mark MPM as power domain Sneh Mankad
2026-07-13 10:39 ` sashiko-bot [this message]
2026-07-13 10:25 ` [PATCH 7/7] arm64: dts: qcom: shikra: Add CPU idle states Sneh Mankad
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=20260713103957.4C0C61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sneh.mankad@oss.qualcomm.com \
/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