From: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>,
Peter Zijlstra <peterz@infradead.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@kernel.org>, Len Brown <lenb@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] arm64: Disallow disabling boot CPU based on config
Date: Tue, 21 Jul 2026 12:29:54 +0530 [thread overview]
Message-ID: <f2d4b312-4a11-425e-8329-33838ed37d15@oss.qualcomm.com> (raw)
In-Reply-To: <akfHIH_dZrr5bosu@J2N7QTR9R3>
On 03-Jul-26 7:58 PM, Mark Rutland wrote:
> On Fri, Jul 03, 2026 at 04:50:02PM +0530, Sneh Mankad wrote:
>> The Qualcomm SoCs like LeMans, Monaco
>
> Are those released products?
Yes, the SoCs are present in upstream:
arch/arm64/boot/dts/qcom/lemans.dtsi
arch/arm64/boot/dts/qcom/monaco.dtsi
>
> Are those mobile phone parts, or somthing else?
These are ride (automotive) chipsets and IoT boards.
>
>> support suspend to ram which leads the SoC to ACPI S3 similar state
>> where SoC is turned off and DDR is retained. The hardware design on
>> these SoCs forces a constraint to suspend and resume the system on
>> boot CPU / CPU0.
>>
>> If CPU0 is already offline before starting suspend to ram the
>> freeze_secondary_cpus() picks alternate CPU as primary / last CPU and
>> proceed further to invoke PSCI SYSTEM_SUSPEND.
>> This leads to a system crash.
>
> Ok, so that's a firmware bug.
>
> Why does the FW permit CPU0 to be offlined in the first place if it
> can't handle this?
FW permits CPU0 disablement because it functions properly in regular run time.
But there is an additional hardware constraint in above mentioned platforms, that
suspend to ram has to be performed via boot CPU / CPU0. Due to this constraint,
CPU0 is required to be online when suspend to ram is triggered.
> What does PSCI_MIGRATE_INFO_TYPE report?
It is a optional function call, which is not implemented in firmware.
> Ideally it'd report Uniprocessor (UP) not migrate capable (1), which
> would prevent CPU_OFF on that CPU, and would force suspend to happen
> there...
Also, above platforms are multicore (8 CPUs each).
>> In order to prevent such an issue introduce PM_SLEEP_SMP_CPU_ZERO_STRICT
>> config and when enabled prohibit the CPU0 from getting disabled.
>
> I don't think it makes sense for this to be a config option.
>
> This is a platform-specific property, and it's possible to build a
> kernel that boots on this platform and/or other platforms.
Yes, but for that reason the config will only be enabled for SoCs that have this
constraint, it will remain disabled for other SoCs.
>> Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
>> ---
>> Changes in v2:
>> - Moved the check to arm64 specific code.
>> - Link to v1: https://lore.kernel.org/r/20260605-disable_boot_cpu_offline-v1-1-4c68fe1a6cf8@oss.qualcomm.com
>> ---
>> arch/arm64/Kconfig | 9 +++++++++
>> arch/arm64/kernel/psci.c | 6 ++++++
>> 2 files changed, 15 insertions(+)
>>
>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> index fe60738e5943ba279e5571862423df4fed3db661..21697a535a25d286a2f8afe4921a41b13cc32c0a 100644
>> --- a/arch/arm64/Kconfig
>> +++ b/arch/arm64/Kconfig
>> @@ -263,6 +263,15 @@ config ARM64
>> help
>> ARM 64-bit (AArch64) Linux support.
>>
>> +config PM_SLEEP_SMP_CPU_ZERO_STRICT
>> + bool "Disallow boot CPU (CPU0) offline"
>> + depends on ARCH_QCOM
>
> Why can't others select this?
I can remove ARCH_QCOM dependency if any other want to use this.
>
>> + depends on HOTPLUG_CPU
>> + depends on SUSPEND
>> + help
>> + Disallow boot CPU (CPU0) offline when the suspend_ops->enter()
>> + has to be executed by boot CPU.
>
> As above, I don't think this makse sense as a config option.
>
> Either we handle the FW bug, or we do not.
>
> Mark.
>
As mentioned above, its not a FW bug. CPU0 is allowed to be disabled from FW and HW constraint is for
suspend to ram to be performed on boot CPU.
Thanks,
Sneh
next prev parent reply other threads:[~2026-07-21 7:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 11:20 Sneh Mankad
2026-07-03 14:28 ` Mark Rutland
2026-07-03 21:09 ` Thomas Gleixner
2026-07-21 6:59 ` Sneh Mankad [this message]
2026-07-21 13:04 ` Mark Rutland
2026-07-21 13:53 ` Sudeep Holla
2026-07-28 10:31 ` Ulf Hansson
2026-07-03 15:51 ` Sudeep Holla
2026-07-04 6:43 ` Daniel Lezcano
2026-07-06 9:16 ` Sudeep Holla
2026-07-09 13:00 ` Daniel Lezcano
2026-07-21 9:28 ` Sneh Mankad
2026-07-21 13:00 ` Mark Rutland
2026-07-21 14:05 ` Sudeep Holla
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=f2d4b312-4a11-425e-8329-33838ed37d15@oss.qualcomm.com \
--to=sneh.mankad@oss.qualcomm.com \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@oss.qualcomm.com \
--cc=lenb@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pavel@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tglx@kernel.org \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®