Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dmitry Osipenko and committed by
Thierry Reding
bdb1ffda faae6c9f

+3
+3
drivers/cpuidle/cpuidle-tegra.c
··· 337 337 338 338 static int tegra_cpuidle_probe(struct platform_device *pdev) 339 339 { 340 + if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NOT_READY) 341 + return -EPROBE_DEFER; 342 + 340 343 /* LP2 could be disabled in device-tree */ 341 344 if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2) 342 345 tegra_cpuidle_disable_state(TEGRA_CC6);