]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pmdomain: core: Add genpd helper to correct the usage/rejected counters
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 14 Mar 2025 10:00:55 +0000 (11:00 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 23 Apr 2025 08:08:33 +0000 (10:08 +0200)
commit9861f21ff16b6cd919144dae7ff355d5145a3474
treed4d212eb7163bdfd95d0c742a92ca0736b25b588
parent9c32cda43eb78f78c73aee4aa344b777714e259b
pmdomain: core: Add genpd helper to correct the usage/rejected counters

In the cpuidle-psci-domain case the ->power_off() callback is usually
returning zero to indicate success. This is because the actual call to the
PSCI FW to enter the selected domain-idlestate, needs to be done after the
->power_off() callback has returned.

When the call to the PSCI FW fails, this leads to receiving an incorrect
tracking of the usage/rejected counts for the selected domain-idlestate.
In other words, the presented debug-statistics for genpd may look better
than what the actually are.

To allow a better correctness of the data, let's add a new genpd helper
function, which enables the caller adjust the usage/rejected counters for a
domain-idlestate, in cases of errors during power-off.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250314100103.1294715-2-ulf.hansson@linaro.org
drivers/pmdomain/core.c
include/linux/pm_domain.h