linux/drivers/pmdomain
Maulik Shah 11c19d42d3 pmdomain: governor: Consider CPU latency tolerance from pm_domain_cpu_gov
commit 500ba33284 upstream.

pm_domain_cpu_gov is selecting a cluster idle state but does not consider
latency tolerance of child CPUs. This results in deeper cluster idle state
whose latency does not meet latency tolerance requirement.

Select deeper idle state only if global and device latency tolerance of all
child CPUs meet.

Test results on SM8750 with 300 usec PM-QoS on CPU0 which is less than
domain idle state entry (2150) + exit (1983) usec latency mentioned in
devicetree, demonstrate the issue.

	# echo 300 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

Before: (Usage is incrementing)
======
	# cat /sys/kernel/debug/pm_genpd/power-domain-cluster0/idle_states
	State          Time Spent(ms) Usage      Rejected   Above      Below
	S0             29817          537        8          270        0

	# cat /sys/kernel/debug/pm_genpd/power-domain-cluster0/idle_states
	State          Time Spent(ms) Usage      Rejected   Above      Below
	S0             30348          542        8          271        0

After: (Usage is not incrementing due to latency tolerance)
======
	# cat /sys/kernel/debug/pm_genpd/power-domain-cluster0/idle_states
	State          Time Spent(ms) Usage      Rejected   Above      Below
	S0             39319          626        14         307        0

	# cat /sys/kernel/debug/pm_genpd/power-domain-cluster0/idle_states
	State          Time Spent(ms) Usage      Rejected   Above      Below
	S0             39319          626        14         307        0

Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Fixes: e94999688e ("PM / Domains: Add genpd governor for CPUs")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250709-pmdomain_qos-v2-1-976b12257899@oss.qualcomm.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-07-24 08:56:27 +02:00
..
actions pmdomain: Use device_get_match_data() 2023-10-17 11:45:11 +02:00
amlogic pmdomain: amlogic: fix T7 ISP secpower 2025-03-28 22:03:31 +01:00
apple pmdomain: apple: Make apple_pmgr_reset_ops static 2024-08-20 11:28:01 +02:00
arm pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names 2024-10-30 17:11:56 +01:00
bcm pmdomain: raspberrypi-power: set flag GENPD_FLAG_ACTIVE_WAKEUP 2024-08-14 14:22:39 +02:00
imx pmdomain: imx: gpcv2: use proper helper for property detection 2025-05-29 11:02:45 +02:00
mediatek pmdomain: mediatek: make use of dev_err_cast_probe() 2024-09-13 12:48:34 +02:00
qcom pmdomain: qcom-cpr: Fix the return of uninitialized variable 2024-10-02 12:38:53 +02:00
renesas pmdomain: renesas: rcar: Remove obsolete nullify checks 2025-05-29 11:03:21 +02:00
rockchip pmdomain: rockchip: Add gating masks for rk3576 2024-09-13 13:01:47 +02:00
samsung pmdomain: samsung: Move Kconfig option to the pmdomain subsystem 2023-10-04 23:41:56 +02:00
st pmdomain: st: Add a Kconfig option for the ux500 power domain 2023-10-04 23:41:56 +02:00
starfive pmdomain: starfive: Update prefixes for AON power domain 2023-10-04 23:41:57 +02:00
sunxi pmdomain: sunxi: Move Kconfig option to the pmdomain subsystem 2023-10-04 23:41:56 +02:00
tegra pmdomain: core: constify of_phandle_args in xlate 2024-02-14 10:26:11 +01:00
ti pmdomain: ti-sci: Add missing of_node_put() for args.np 2024-12-05 14:01:32 +01:00
xilinx pmdomain: core: constify of_phandle_args in xlate 2024-02-14 10:26:11 +01:00
core.c pmdomain: core: Reset genpd->states to avoid freeing invalid data 2025-06-27 11:11:27 +01:00
governor.c pmdomain: governor: Consider CPU latency tolerance from pm_domain_cpu_gov 2025-07-24 08:56:27 +02:00
Kconfig pmdomain: arm_scmi: Move Kconfig options to the pmdomain subsystem 2023-11-23 17:32:53 +01:00
Makefile PM: domains: Move genpd and its governor to the pmdomain subsystem 2023-12-18 12:49:48 +01:00