[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250425-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-v2-0-f1530de9da42@linaro.org>
Date: Fri, 25 Apr 2025 17:25:04 +0100
From: Peter Griffin <peter.griffin@...aro.org>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Alim Akhtar <alim.akhtar@...sung.com>
Cc: devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
tudor.ambarus@...aro.org, andre.draszik@...aro.org, willmcvicker@...gle.com,
kernel-team@...roid.com, Peter Griffin <peter.griffin@...aro.org>
Subject: [PATCH v2 0/5] Fix gs101 CPU hotplug support
Hi folks,
As part of an effort to make suspend to RAM functional upstream on
Pixel 6 I noticed that CPU hotplug leads to a system hang.
After debugging and comparing with downstream drivers it became clear
that some extra register writes are required to make CPU hotplug
functional on these older devices which use a el3mon firmware.
This series adds support for that programming the CPU_INFORM register
hint required by the firmware and also adds support for the pmu-intr-gen
register region which is now modelled as it's own syscon. With these
changes CPU hotplug is now functional.
It can be tested with commands such as
echo 0 > /sys/devices/system/cpu/cpu6/online
echo 1 > /sys/devices/system/cpu/cpu6/online
[ 15.880597][ T0] Detected PIPT I-cache on CPU6
[ 15.880638][ T0] GICv3: CPU6: found redistributor 600 region 0:0x0000000010500000
[ 15.880685][ T0] CPU6: Booted secondary processor 0x0000000600 [0x411fd440]
This would (prior to this series) hang the system.
As more of a stress test, I ran a script hotplugging CPUs 1 to 7 in a
loop 200 times which also completed suucessfully. In addition using the
recent fuel gauge series from Thomas we can also verify that the power
reduces once the CPU's are offlined.
Note 1: It is highly likely that similar changes are required for other
Exynos based SoCs using el3mon. For anyone following along who is
accustomed to looking at downstream Exynos based drivers this replaces
register writes defined in
drivers/soc/<google|samsung>/cal-if/<socname>/flexpmu_cal_cpu_<socname>.h
Which are used by files in the cal-if folder and exynos-cpupm.c driver.
For the moment I've used the GS101 CPU inform register offsets directly
but these can be moved to driver data once we've established other SoCs
benefit from this.
Note 2: To ensure older DTs which don't specify google,pmu-intr-gen-syscon
phandle still work. The driver only issues a warning if the syscon can't
be obtained, and the behaviour remains the same as today (system boots, but
CPU hotplug will not be functional).
Note 3: I've added the bindings doc google,gs101-pmu-intr-gen.yaml in a new
google folder as it seemed odd to have it in the soc/samsung directory, but
it's likely this may be re-used by other Exynos SoCs that use APM/ACPM.
kind regards,
Peter
Signed-off-by: Peter Griffin <peter.griffin@...aro.org>
---
Changes in v2:
* Use BIT macro (Kryzstof)
* Use gs101_ prefix for cpuhp functions (Kryzstof)
* Model pmu-intr-gen SFR region as it's own syscon (Kryzstof)
* Use regmap_update_bits() API (Kryzstof)
* Program hint on current processor (Peter)
- Link to v1: https://lore.kernel.org/r/20241213-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-v1-0-c72978f63713@linaro.org
---
Peter Griffin (5):
dt-bindings: soc: google: Add gs101-pmu-intr-gen binding documentation
dt-bindings: soc: samsung: exynos-pmu: gs101: add google,pmu-intr-gen phandle
MAINTAINERS: Add google,gs101-pmu-intr-gen.yaml binding file
arm64: dts: exynos: gs101: add pmu-intr-gen syscon node
soc: samsung: exynos-pmu: enable CPU hotplug support for gs101
.../soc/google/google,gs101-pmu-intr-gen.yaml | 35 ++++++++++
.../bindings/soc/samsung/exynos-pmu.yaml | 15 ++++
MAINTAINERS | 1 +
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 6 ++
drivers/soc/samsung/exynos-pmu.c | 80 +++++++++++++++++++++-
drivers/soc/samsung/exynos-pmu.h | 1 +
include/linux/soc/samsung/exynos-regs-pmu.h | 11 +++
7 files changed, 148 insertions(+), 1 deletion(-)
---
base-commit: 393d0c54cae31317deaa9043320c5fd9454deabc
change-id: 20241213-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-1f7ad4c45901
Best regards,
--
Peter Griffin <peter.griffin@...aro.org>
Powered by blists - more mailing lists