Message ID | 20250506-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-v4-0-9f64a2657316@linaro.org |
---|---|
Headers | show |
Series | Fix gs101 CPU hotplug support | expand |
On Tue, 06 May 2025 21:57:26 +0100, Peter Griffin wrote: > 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. > > [...] Applied, thanks! [1/5] dt-bindings: soc: google: Add gs101-pmu-intr-gen binding documentation https://git.kernel.org/krzk/linux/c/0475b0d8a1e0f80a47536dfb19c28dc4bb6adc05 [2/5] dt-bindings: soc: samsung: exynos-pmu: gs101: add google,pmu-intr-gen phandle https://git.kernel.org/krzk/linux/c/83b66cdb5d5b6aa4ed1f085b3b2f917af0c2890b [3/5] MAINTAINERS: Add google,gs101-pmu-intr-gen.yaml binding file https://git.kernel.org/krzk/linux/c/20adeaca8bc6a084f2610e7c89a8601c9904a0e2 [4/5] arm64: dts: exynos: gs101: add pmu-intr-gen syscon node https://git.kernel.org/krzk/linux/c/aaf02428fdd50b818c77644bc0b8a0b282ce8ea4 [5/5] soc: samsung: exynos-pmu: enable CPU hotplug support for gs101 https://git.kernel.org/krzk/linux/c/598995027b9181ada81789bf01fb8ef30d93c9dc Best regards,
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@linaro.org> --- Changes in v4: - Add trailers - Fix typo with GS101_GRP1_INTR_BID_CLEAR in gs101_cpuhp_pmu_offline() (Peter) - Link to v3: https://lore.kernel.org/r/20250429-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-v3-0-1bcc44fb1d55@linaro.org Changes in v3: - Fix $id, relative path/filename doesn't match actual path or filename (Robs patch bot) - Link to v2: https://lore.kernel.org/r/20250425-contrib-pg-cpu-hotplug-suspend2ram-fixes-v1-v2-0-f1530de9da42@linaro.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,