diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2024-04-12 12:42:07 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2024-04-18 16:52:47 +0200 |
commit | 5af7f593be821eb28ce81a91aac71ccdf9dbe4d5 (patch) | |
tree | 3ca7e45decdd3d833bbe3ac766e306a5e5cfc34b /drivers/pmdomain | |
parent | fdea114ac26ce0eae4e248e6194d39e4e7536f7a (diff) |
pmdomain: core: Update the rejected/usage counters at system suspend too
During system suspend we may try to enter a low power-state for the genpd
in question. Let's take this into account for the statistics too, by
updating the rejected/usage counters for the corresponding state.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20240412104208.74361-1-ulf.hansson@linaro.org
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r-- | drivers/pmdomain/core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 4215ffd9b11c..903ea0c193e1 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -1178,8 +1178,12 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock, /* Choose the deepest state when suspending */ genpd->state_idx = genpd->state_count - 1; - if (_genpd_power_off(genpd, false)) + if (_genpd_power_off(genpd, false)) { + genpd->states[genpd->state_idx].rejected++; return; + } else { + genpd->states[genpd->state_idx].usage++; + } genpd->status = GENPD_STATE_OFF; |