PM: domains: Fix initialization of genpd's next_wakeup
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 May 2022 14:57:00 +0000 (16:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:01 +0000 (10:23 +0200)
commit37fd61fc7020de778211aa091429d5a7741ecb0e
tree0dd16a7926a76980afa5d93f47cbaf732d6145ea
parent85a18d128d18ee88339faee8866d7e20f1a6c518
PM: domains: Fix initialization of genpd's next_wakeup

[ Upstream commit 622d9b5577f19a6472db21df042fea8f5fefe244 ]

In the genpd governor we walk the list of child-domains to take into
account their next_wakeup. If the child-domain itself, doesn't have a
governor assigned to it, we can end up using the next_wakeup value before
it has been properly initialized. To prevent a possible incorrect behaviour
in the governor, let's initialize next_wakeup to KTIME_MAX.

Fixes: c79aa080fb0f ("PM: domains: use device's next wakeup to determine domain idle state")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/power/domain.c