Skip to content

Commit f694481

Browse files
committed
ACPI: processor: Rescan "dead" SMT siblings during initialization
Make acpi_processor_driver_init() call arch_cpu_rescan_dead_smt_siblings(), via a new wrapper function called acpi_idle_rescan_dead_smt_siblings(), after successfully initializing the driver, to allow the "dead" SMT siblings to go into deep idle states, which is necessary for the processor to be able to reach deep package C-states (like PC10) going forward, so that power can be reduced sufficiently in suspend-to-idle, among other things. However, do it only if the ACPI idle driver is the current cpuidle driver (otherwise it is assumed that another cpuidle driver will take care of this) and avoid doing it on architectures other than x86. Signed-off-by: Rafael J. Wysocki <[email protected]> Tested-by: Artem Bityutskiy <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent a430c11 commit f694481

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

drivers/acpi/internal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ bool processor_physically_present(acpi_handle handle);
175175
static inline void acpi_early_processor_control_setup(void) {}
176176
#endif
177177

178+
#ifdef CONFIG_ACPI_PROCESSOR_CSTATE
179+
void acpi_idle_rescan_dead_smt_siblings(void);
180+
#else
181+
static inline void acpi_idle_rescan_dead_smt_siblings(void) {}
182+
#endif
183+
178184
/* --------------------------------------------------------------------------
179185
Embedded Controller
180186
-------------------------------------------------------------------------- */

drivers/acpi/processor_driver.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ static int __init acpi_processor_driver_init(void)
279279
* after acpi_cppc_processor_probe() has been called for all online CPUs
280280
*/
281281
acpi_processor_init_invariance_cppc();
282+
283+
acpi_idle_rescan_dead_smt_siblings();
284+
282285
return 0;
283286
err:
284287
driver_unregister(&acpi_processor_driver);

drivers/acpi/processor_idle.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <acpi/processor.h>
2525
#include <linux/context_tracking.h>
2626

27+
#include "internal.h"
28+
2729
/*
2830
* Include the apic definitions for x86 to have the APIC timer related defines
2931
* available also for UP (on SMP it gets magically included via linux/smp.h).
@@ -55,6 +57,12 @@ struct cpuidle_driver acpi_idle_driver = {
5557
};
5658

5759
#ifdef CONFIG_ACPI_PROCESSOR_CSTATE
60+
void acpi_idle_rescan_dead_smt_siblings(void)
61+
{
62+
if (cpuidle_get_driver() == &acpi_idle_driver)
63+
arch_cpu_rescan_dead_smt_siblings();
64+
}
65+
5866
static
5967
DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX], acpi_cstate);
6068

0 commit comments

Comments
 (0)