Commit 5af7f593 authored by Ulf Hansson's avatar Ulf Hansson
Browse files

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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20240412104208.74361-1-ulf.hansson@linaro.org
parent fdea114a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;