static int acpi_processor_setup_cstates(struct acpi_processor *pr)
{
- int i, count = ACPI_IDLE_STATE_START;
+ int i, count;
struct acpi_processor_cx *cx;
struct cpuidle_state *state;
struct cpuidle_driver *drv = &acpi_idle_driver;
if (max_cstate == 0)
max_cstate = 1;
+ if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) {
+ cpuidle_poll_state_init(drv);
+ count = 1;
+ } else {
+ count = 0;
+ }
+
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
cx = &pr->power.states[i];
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
(void *)1, 1);
- poll_idle_init(drv);
-
return 0;
}
return index;
}
-void poll_idle_init(struct cpuidle_driver *drv)
+void cpuidle_poll_state_init(struct cpuidle_driver *drv)
{
struct cpuidle_state *state = &drv->states[0];
state->disabled = false;
state->flags = CPUIDLE_FLAG_POLLING;
}
+EXPORT_SYMBOL_GPL(cpuidle_poll_state_init);
intel_idle_state_table_update();
+ cpuidle_poll_state_init(drv);
drv->state_count = 1;
for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
#endif
#ifdef CONFIG_ARCH_HAS_CPU_RELAX
-void poll_idle_init(struct cpuidle_driver *drv);
+void cpuidle_poll_state_init(struct cpuidle_driver *drv);
#else
-static void poll_idle_init(struct cpuidle_driver *drv) {}
+static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}
#endif
/******************************