From: sashiko-bot@kernel.org
To: "Nikolai Burov" <nikolai.burov@jolla.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/3] pmdomain: mediatek: Add support for secure modem power domain control
Date: Tue, 14 Jul 2026 13:51:38 +0000 [thread overview]
Message-ID: <20260714135139.59FB21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260714-mt6858-pmdomain-v1-2-4f09bbb822e0@jolla.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Secure modem power domain is powered off prematurely in the teardown sequence, violating hardware requirements and potentially causing bus timeouts or lockups (SError).
--
--- Patch [2]: [PATCH 2/3] pmdomain: mediatek: Add support for secure modem power domain control ---
commit 6dae8fe193509453ecfd352eacac6f51667e9e72
Author: Nikolai Burov <nikolai.burov@jolla.com>
pmdomain: mediatek: Add support for secure modem power domain control
This commit adds a flag to enable a secure monitor call (SMC) to turn
the modem power domain on or off on recent MediaTek SoCs. The sequence is
needed because firmware prevents direct modification of the power domain
control register.
> diff --git a/drivers/pmdomain/mediatek/mtk-pm-domains.c b/drivers/pmdomain/mediatek/mtk-pm-domains.c
> --- a/drivers/pmdomain/mediatek/mtk-pm-domains.c
> +++ b/drivers/pmdomain/mediatek/mtk-pm-domains.c
[ ... ]
> @@ -709,6 +745,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
> if (ret < 0)
> return ret;
>
> + if (MTK_SCPD_CAPS(pd, MTK_SCPD_MODEM_SECURE)) {
> + ret = scpsys_modem_sec_power_on(false);
> + if (ret)
> + return ret;
> + }
> +
> if (pd->data->ext_buck_iso_offs && MTK_SCPD_CAPS(pd, MTK_SCPD_EXT_BUCK_ISO))
> regmap_set_bits(scpsys->base, pd->data->ext_buck_iso_offs,
> pd->data->ext_buck_iso_mask);
[Severity: High]
Does calling scpsys_modem_sec_power_on(false) here power off the domain
prematurely?
The secure modem domain is being shut down before isolating the bus and
disabling the subsystem clocks. Could this cause AXI bus lockups (SError)
and crash the system?
[ ... ]
> @@ -719,10 +761,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
> if (ret < 0)
> return ret;
>
> - if (MTK_SCPD_CAPS(pd, MTK_SCPD_MODEM_PWRSEQ))
> - scpsys_modem_pwrseq_off(pd);
> - else
> - scpsys_ctl_pwrseq_off(pd);
> + if (!MTK_SCPD_CAPS(pd, MTK_SCPD_MODEM_SECURE)) {
> + if (MTK_SCPD_CAPS(pd, MTK_SCPD_MODEM_PWRSEQ))
> + scpsys_modem_pwrseq_off(pd);
> + else
> + scpsys_ctl_pwrseq_off(pd);
> + }
>
> /* wait until PWR_ACK = 0 */
[Severity: High]
Should the scpsys_modem_sec_power_on(false) call be moved down here?
For non-secure domains, the actual power down happens here after the bus
protection and clock disable steps have executed.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260714-mt6858-pmdomain-v1-0-4f09bbb822e0@jolla.com?part=2
next prev parent reply other threads:[~2026-07-14 13:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 13:43 [PATCH 0/3] pmdomain: mediatek: Add MT6858 support Nikolai Burov via B4 Relay
2026-07-14 13:43 ` [PATCH 1/3] dt-bindings: power: Add MediaTek MT6858 power domain controller Nikolai Burov via B4 Relay
2026-07-14 13:49 ` sashiko-bot
2026-07-14 13:43 ` [PATCH 2/3] pmdomain: mediatek: Add support for secure modem power domain control Nikolai Burov via B4 Relay
2026-07-14 13:51 ` sashiko-bot [this message]
2026-07-14 15:28 ` Matthias Brugger
2026-07-14 13:43 ` [PATCH 3/3] pmdomain: mediatek: Add support for MT6858 SoC Nikolai Burov via B4 Relay
2026-07-14 13:58 ` sashiko-bot
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=20260714135139.59FB21F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=nikolai.burov@jolla.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