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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
"Fix idle states enumeration in the intel_idle driver on platforms
supporting multiple flavors of the C6 idle state (Artem Bityutskiy)"

* tag 'pm-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
intel_idle: fix ACPI _CST matching for newer Xeon platforms

+29 -8
+29 -8
drivers/idle/intel_idle.c
··· 121 121 #define CPUIDLE_FLAG_INIT_XSTATE BIT(17) 122 122 123 123 /* 124 + * Ignore the sub-state when matching mwait hints between the ACPI _CST and 125 + * custom tables. 126 + */ 127 + #define CPUIDLE_FLAG_PARTIAL_HINT_MATCH BIT(18) 128 + 129 + /* 124 130 * MWAIT takes an 8-bit "hint" in EAX "suggesting" 125 131 * the C-state (top nibble) and sub-state (bottom nibble) 126 132 * 0x00 means "MWAIT(C1)", 0x10 means "MWAIT(C2)" etc. ··· 1049 1043 .name = "C6", 1050 1044 .desc = "MWAIT 0x20", 1051 1045 .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED | 1052 - CPUIDLE_FLAG_INIT_XSTATE, 1046 + CPUIDLE_FLAG_INIT_XSTATE | 1047 + CPUIDLE_FLAG_PARTIAL_HINT_MATCH, 1053 1048 .exit_latency = 170, 1054 1049 .target_residency = 650, 1055 1050 .enter = &intel_idle, ··· 1059 1052 .name = "C6P", 1060 1053 .desc = "MWAIT 0x21", 1061 1054 .flags = MWAIT2flg(0x21) | CPUIDLE_FLAG_TLB_FLUSHED | 1062 - CPUIDLE_FLAG_INIT_XSTATE, 1055 + CPUIDLE_FLAG_INIT_XSTATE | 1056 + CPUIDLE_FLAG_PARTIAL_HINT_MATCH, 1063 1057 .exit_latency = 210, 1064 1058 .target_residency = 1000, 1065 1059 .enter = &intel_idle, ··· 1362 1354 { 1363 1355 .name = "C6S", 1364 1356 .desc = "MWAIT 0x22", 1365 - .flags = MWAIT2flg(0x22) | CPUIDLE_FLAG_TLB_FLUSHED, 1357 + .flags = MWAIT2flg(0x22) | CPUIDLE_FLAG_TLB_FLUSHED | 1358 + CPUIDLE_FLAG_PARTIAL_HINT_MATCH, 1366 1359 .exit_latency = 270, 1367 1360 .target_residency = 700, 1368 1361 .enter = &intel_idle, ··· 1371 1362 { 1372 1363 .name = "C6SP", 1373 1364 .desc = "MWAIT 0x23", 1374 - .flags = MWAIT2flg(0x23) | CPUIDLE_FLAG_TLB_FLUSHED, 1365 + .flags = MWAIT2flg(0x23) | CPUIDLE_FLAG_TLB_FLUSHED | 1366 + CPUIDLE_FLAG_PARTIAL_HINT_MATCH, 1375 1367 .exit_latency = 310, 1376 1368 .target_residency = 900, 1377 1369 .enter = &intel_idle, ··· 1754 1744 } 1755 1745 } 1756 1746 1757 - static bool __init intel_idle_off_by_default(u32 mwait_hint) 1747 + static bool __init intel_idle_off_by_default(unsigned int flags, u32 mwait_hint) 1758 1748 { 1759 1749 int cstate, limit; 1760 1750 ··· 1771 1761 * the interesting states are ACPI_CSTATE_FFH. 1772 1762 */ 1773 1763 for (cstate = 1; cstate < limit; cstate++) { 1774 - if (acpi_state_table.states[cstate].address == mwait_hint) 1764 + u32 acpi_hint = acpi_state_table.states[cstate].address; 1765 + u32 table_hint = mwait_hint; 1766 + 1767 + if (flags & CPUIDLE_FLAG_PARTIAL_HINT_MATCH) { 1768 + acpi_hint &= ~MWAIT_SUBSTATE_MASK; 1769 + table_hint &= ~MWAIT_SUBSTATE_MASK; 1770 + } 1771 + 1772 + if (acpi_hint == table_hint) 1775 1773 return false; 1776 1774 } 1777 1775 return true; ··· 1789 1771 1790 1772 static inline bool intel_idle_acpi_cst_extract(void) { return false; } 1791 1773 static inline void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { } 1792 - static inline bool intel_idle_off_by_default(u32 mwait_hint) { return false; } 1774 + static inline bool intel_idle_off_by_default(unsigned int flags, u32 mwait_hint) 1775 + { 1776 + return false; 1777 + } 1793 1778 #endif /* !CONFIG_ACPI_PROCESSOR_CSTATE */ 1794 1779 1795 1780 /** ··· 2119 2098 2120 2099 if ((disabled_states_mask & BIT(drv->state_count)) || 2121 2100 ((icpu->use_acpi || force_use_acpi) && 2122 - intel_idle_off_by_default(mwait_hint) && 2101 + intel_idle_off_by_default(state->flags, mwait_hint) && 2123 2102 !(state->flags & CPUIDLE_FLAG_ALWAYS_ENABLE))) 2124 2103 state->flags |= CPUIDLE_FLAG_OFF; 2125 2104