From: Sudeep Holla <sudeep.holla@arm.com>
To: Peter Griffin <peter.griffin@linaro.org>
Cc: "André Draszik" <andre.draszik@linaro.org>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"William Mcvicker" <willmcvicker@google.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@android.com
Subject: Re: [PATCH v5] soc: samsung: exynos-pmu: Enable CPU Idle for gs101
Date: Thu, 10 Jul 2025 17:02:03 +0100 [thread overview]
Message-ID: <20250710-translucent-mastiff-of-performance-b5f1ba@sudeepholla> (raw)
In-Reply-To: <CADrjBPqYSVO20a0ox9un0fq7dBss9sMGK1Q3ivCjCGaFyqhZFA@mail.gmail.com>
On Wed, Jul 09, 2025 at 10:36:59PM +0100, Peter Griffin wrote:
> Hi Sudeep,
>
> Thanks for your review feedback!
>
> On Wed, 9 Jul 2025 at 17:10, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Wed, Jul 09, 2025 at 02:26:27PM +0100, Peter Griffin wrote:
> > > Register cpu pm notifiers for gs101 which call the
> > > gs101_cpu_pmu_online/offline callbacks which in turn program the ACPM
> > > C2 hint. This hint is required to actually enter the C2 idle state.
> > >
> > > A couple of corner cases are handled, namely when the system is rebooting
> > > or suspending we ignore the request. Additionally the request is ignored if
> > > the CPU is in CPU hot plug. Some common code is refactored so that it can
> > > be called from both the CPU hot plug callbacks and CPU PM notifier taking
> > > into account that CPU PM notifiers are called with IRQs disabled whereas
> > > CPU hotplug callbacks are not.
> > >
> > > Additionally due to CPU PM notifiers using raw_spinlock the locking is
> > > updated to use raw_spinlock variants, this includes updating the pmu_regs
> > > regmap to use .use_raw_spinlock = true and additionally creating and
> > > registering a custom pmu-intr-gen regmap instead of using the regmap
> > > provided by syscon.
> > >
> > > Note: this patch has a runtime dependency on adding 'local-timer-stop' dt
> > > property to the CPU nodes. This informs the time framework to switch to a
> > > broadcast timer as the local timer will be shutdown. Without that DT
> > > property specified the system hangs in early boot with this patch applied.
> > >
> >
> > Assuming this is arm64 platform and using PSCI for all the power management,
> > can you please briefly explain why all these dance is absolutely necessary
> > when PSCI calls can be the clue for the EL3 firmware. I am basing my question
> > on this information in the file:
>
> Yes, you're correct it is an arm64 platform using PSCI. Unfortunately
> I don't have access to the el3mon firmware code to speak super
> authoritatively about it, but you're correct that it is essentially
> working around a firmware limitation.
>
> What I initially observed whilst working on suspend to RAM, when
> hotplugging CPU's with just the PSCI calls the system hangs. Debugging
> this and tracing versus the downstream production drivers the missing
> piece was programming the "ACPM hint" to the CPU_INFORM registers.
> Further debugging and power measurements also showed that the ACPM
> hint is also required in addition to PSCI calls for the cpuidle states
> to function correctly.
>
It is definitely worth adding all the above info and shaming the firmware
for not taking care of this. I still don't like this as PSCI is there
for nearly a decade now and still we see such limitations that needs to
be fixed in the firmware and now workaround in the kernel.
> > /*
> > * CPU_INFORM register hint values which are used by
> > * EL3 firmware (el3mon).
> > */
> >
> > This clearly sounds like workaround for the firmware limitations. That
> > needs to be clearly documented IMO.
>
> Sure I can add a more verbose comment, that this is required to work
> around firmware limitations in the PSCI implementation.
>
Thanks that's what we need to fully understand the need of otherwise
useless dance around hotplug and idle state machinery in the kernel.
--
Regards,
Sudeep
prev parent reply other threads:[~2025-07-10 18:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 13:26 [PATCH v5] soc: samsung: exynos-pmu: Enable CPU Idle for gs101 Peter Griffin
2025-07-09 16:10 ` Sudeep Holla
2025-07-09 21:36 ` Peter Griffin
2025-07-10 16:02 ` Sudeep Holla [this message]
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=20250710-translucent-mastiff-of-performance-b5f1ba@sudeepholla \
--to=sudeep.holla@arm.com \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=kernel-team@android.com \
--cc=krzk@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.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;
as well as URLs for NNTP newsgroup(s).