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

cpuidle: psci: Fail cpuidle registration if set OSI mode failed

Currently we allow the cpuidle driver registration to succeed, even if we
failed to enable the OSI mode when the hierarchical DT layout is used. This
means running in a degraded mode, by using the available idle states per
CPU, while also preventing the domain idle states.

Moving forward, this behaviour looks quite questionable to maintain, as
complexity seems to grow around it, especially when trying to add support
for deferred probe, for example.

Therefore, let's make the cpuidle driver registration to fail in this
situation, thus relying on the default architectural cpuidle backend for
WFI to be used.

Reviewed-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Ulf Hansson and committed by
Rafael J. Wysocki
4b072cd6 03175619

-5
-5
drivers/cpuidle/cpuidle-psci-domain.c
··· 26 26 }; 27 27 28 28 static LIST_HEAD(psci_pd_providers); 29 - static bool osi_mode_enabled __initdata; 30 29 31 30 static int psci_pd_power_off(struct generic_pm_domain *pd) 32 31 { ··· 271 272 goto remove_pd; 272 273 } 273 274 274 - osi_mode_enabled = true; 275 275 of_node_put(np); 276 276 pr_info("Initialized CPU PM domain topology\n"); 277 277 return pd_count; ··· 290 292 struct device __init *psci_dt_attach_cpu(int cpu) 291 293 { 292 294 struct device *dev; 293 - 294 - if (!osi_mode_enabled) 295 - return NULL; 296 295 297 296 dev = dev_pm_domain_attach_by_name(get_cpu_device(cpu), "psci"); 298 297 if (IS_ERR_OR_NULL(dev))