mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
ACPI: processor: idle: Relocate state flags initialization
Since acpi_processor_setup_cstates() is a more logical place for setting idle state flags than acpi_processor_setup_cpuidle_cx(), move that code from the latter to the former. It also allows direct references to acpi_idle_driver in acpi_processor_setup_cpuidle_cx() to be avoided. No intentional functional impact. Signed-off-by: Huisong Li <lihuisong@huawei.com> [ rjw: Subject and changelog rewrite ] Link: https://patch.msgid.link/20250929093754.3998136-5-lihuisong@huawei.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
211ddde082
commit
945661d581
|
|
@ -737,13 +737,11 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
|
|||
{
|
||||
int i, count = ACPI_IDLE_STATE_START;
|
||||
struct acpi_processor_cx *cx;
|
||||
struct cpuidle_state *state;
|
||||
|
||||
if (max_cstate == 0)
|
||||
max_cstate = 1;
|
||||
|
||||
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
|
||||
state = &acpi_idle_driver.states[count];
|
||||
cx = &pr->power.states[i];
|
||||
|
||||
if (!cx->valid)
|
||||
|
|
@ -751,15 +749,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
|
|||
|
||||
per_cpu(acpi_cstate[count], dev->cpu) = cx;
|
||||
|
||||
if (lapic_timer_needs_broadcast(pr, cx))
|
||||
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
|
||||
|
||||
if (cx->type == ACPI_STATE_C3) {
|
||||
state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
|
||||
if (pr->flags.bm_check)
|
||||
state->flags |= CPUIDLE_FLAG_RCU_IDLE;
|
||||
}
|
||||
|
||||
count++;
|
||||
if (count == CPUIDLE_STATE_MAX)
|
||||
break;
|
||||
|
|
@ -818,6 +807,15 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
|
|||
if (cx->type != ACPI_STATE_C1 && !acpi_idle_fallback_to_c1(pr))
|
||||
state->enter_s2idle = acpi_idle_enter_s2idle;
|
||||
|
||||
if (lapic_timer_needs_broadcast(pr, cx))
|
||||
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
|
||||
|
||||
if (cx->type == ACPI_STATE_C3) {
|
||||
state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
|
||||
if (pr->flags.bm_check)
|
||||
state->flags |= CPUIDLE_FLAG_RCU_IDLE;
|
||||
}
|
||||
|
||||
count++;
|
||||
if (count == CPUIDLE_STATE_MAX)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user