summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-09-12 22:29:07 +0200
committerThierry Reding <treding@nvidia.com>2021-10-05 19:11:40 +0200
commitbdb1ffdad3b73e4d0538098fc02e2ea87a6b27cd (patch)
tree72c1d3982bd3848dc7221844643b223e5f5212d9 /drivers/cpuidle
parentcpuidle: tegra: Enable compile testing (diff)
downloadlinux-bdb1ffdad3b73e4d0538098fc02e2ea87a6b27cd.tar.xz
linux-bdb1ffdad3b73e4d0538098fc02e2ea87a6b27cd.zip
cpuidle: tegra: Check whether PMC is ready
Check whether PMC is ready before proceeding with the cpuidle registration. This fixes racing with the PMC driver probe order, which results in a disabled deepest CC6 idling state if cpuidle driver is probed before the PMC. Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle-tegra.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c
index 508bd9f23792..9845629aeb6d 100644
--- a/drivers/cpuidle/cpuidle-tegra.c
+++ b/drivers/cpuidle/cpuidle-tegra.c
@@ -337,6 +337,9 @@ static void tegra_cpuidle_setup_tegra114_c7_state(void)
static int tegra_cpuidle_probe(struct platform_device *pdev)
{
+ if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NOT_READY)
+ return -EPROBE_DEFER;
+
/* LP2 could be disabled in device-tree */
if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2)
tegra_cpuidle_disable_state(TEGRA_CC6);