Skip to content

Commit 9200f40

Browse files
dedekindheynemax
authored andcommitted
intel_idle: make SPR C1 and C1E be independent
This patch partially reverts the changes made by the following commit: da0e58c intel_idle: add 'preferred_cstates' module argument As that commit describes, on early Sapphire Rapids Xeon platforms the C1 and C1E states were mutually exclusive, so that users could only have either C1 and C6, or C1E and C6. However, Intel firmware engineers managed to remove this limitation and make C1 and C1E to be completely independent, just like on previous Xeon platforms. Therefore, this patch: * Removes commentary describing the old, and now non-existing SPR C1E limitation. * Marks SPR C1E as available by default. * Removes the 'preferred_cstates' parameter handling for SPR. Both C1 and C1E will be available regardless of 'preferred_cstates' value. We expect that all SPR systems are shipping with new firmware, which includes the C1/C1E improvement. Cc: v5.18+ <[email protected]> # v5.18+ Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4c55b92 commit 9200f40

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

drivers/idle/intel_idle.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -785,16 +785,6 @@ static struct cpuidle_state icx_cstates[] __initdata = {
785785
.enter = NULL }
786786
};
787787

788-
/*
789-
* On Sapphire Rapids Xeon C1 has to be disabled if C1E is enabled, and vice
790-
* versa. On SPR C1E is enabled only if "C1E promotion" bit is set in
791-
* MSR_IA32_POWER_CTL. But in this case there effectively no C1, because C1
792-
* requests are promoted to C1E. If the "C1E promotion" bit is cleared, then
793-
* both C1 and C1E requests end up with C1, so there is effectively no C1E.
794-
*
795-
* By default we enable C1 and disable C1E by marking it with
796-
* 'CPUIDLE_FLAG_UNUSABLE'.
797-
*/
798788
static struct cpuidle_state spr_cstates[] __initdata = {
799789
{
800790
.name = "C1",
@@ -807,8 +797,7 @@ static struct cpuidle_state spr_cstates[] __initdata = {
807797
{
808798
.name = "C1E",
809799
.desc = "MWAIT 0x01",
810-
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE | \
811-
CPUIDLE_FLAG_UNUSABLE,
800+
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
812801
.exit_latency = 2,
813802
.target_residency = 4,
814803
.enter = &intel_idle,
@@ -1604,17 +1593,6 @@ static void __init spr_idle_state_table_update(void)
16041593
{
16051594
unsigned long long msr;
16061595

1607-
/* Check if user prefers C1E over C1. */
1608-
if ((preferred_states_mask & BIT(2)) &&
1609-
!(preferred_states_mask & BIT(1))) {
1610-
/* Disable C1 and enable C1E. */
1611-
spr_cstates[0].flags |= CPUIDLE_FLAG_UNUSABLE;
1612-
spr_cstates[1].flags &= ~CPUIDLE_FLAG_UNUSABLE;
1613-
1614-
/* Enable C1E using the "C1E promotion" bit. */
1615-
c1e_promotion = C1E_PROMOTION_ENABLE;
1616-
}
1617-
16181596
/*
16191597
* By default, the C6 state assumes the worst-case scenario of package
16201598
* C6. However, if PC6 is disabled, we update the numbers to match

0 commit comments

Comments
 (0)