mirror of https://github.com/torvalds/linux.git
Merge back ACPI processor driver changes for 6.19
This commit is contained in:
commit
9fac2a114b
|
|
@ -54,7 +54,7 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
|
|||
if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
|
||||
return -ENODEV;
|
||||
|
||||
if (device_declaration && (apic->uid == acpi_id)) {
|
||||
if (apic->uid == acpi_id && (device_declaration || acpi_id < 255)) {
|
||||
*apic_id = apic->local_apic_id;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -732,18 +732,16 @@ static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
|
||||
struct cpuidle_device *dev)
|
||||
static void acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
|
||||
struct cpuidle_device *dev)
|
||||
{
|
||||
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,27 +749,13 @@ 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;
|
||||
}
|
||||
|
||||
if (!count)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_processor_setup_cstates(struct acpi_processor *pr)
|
||||
static void acpi_processor_setup_cstates(struct acpi_processor *pr)
|
||||
{
|
||||
int i, count;
|
||||
struct acpi_processor_cx *cx;
|
||||
|
|
@ -818,17 +802,21 @@ 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;
|
||||
}
|
||||
|
||||
drv->state_count = count;
|
||||
|
||||
if (!count)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void acpi_processor_cstate_first_run_checks(void)
|
||||
|
|
@ -1243,7 +1231,8 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
|
|||
if (pr->flags.has_lpi)
|
||||
return acpi_processor_setup_lpi_states(pr);
|
||||
|
||||
return acpi_processor_setup_cstates(pr);
|
||||
acpi_processor_setup_cstates(pr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1263,7 +1252,8 @@ static int acpi_processor_setup_cpuidle_dev(struct acpi_processor *pr,
|
|||
if (pr->flags.has_lpi)
|
||||
return acpi_processor_ffh_lpi_probe(pr->id);
|
||||
|
||||
return acpi_processor_setup_cpuidle_cx(pr, dev);
|
||||
acpi_processor_setup_cpuidle_cx(pr, dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_processor_get_power_info(struct acpi_processor *pr)
|
||||
|
|
|
|||
Loading…
Reference in New Issue