Skip to content

Commit 3a9cf77

Browse files
dedekindrafaeljw
authored andcommitted
intel_idle: add core C6 optimization for SPR
Add a Sapphire Rapids Xeon C6 optimization, similar to what we have for Sky Lake Xeon: if package C6 is disabled, adjust C6 exit latency and target residency to match core C6 values, instead of using the default package C6 values. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent da0e58c commit 3a9cf77

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/idle/intel_idle.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,8 @@ static void __init skx_idle_state_table_update(void)
15781578
*/
15791579
static void __init spr_idle_state_table_update(void)
15801580
{
1581+
unsigned long long msr;
1582+
15811583
/* Check if user prefers C1E over C1. */
15821584
if (preferred_states_mask & BIT(2)) {
15831585
if (preferred_states_mask & BIT(1))
@@ -1591,6 +1593,19 @@ static void __init spr_idle_state_table_update(void)
15911593
c1e_promotion_enable();
15921594
disable_promotion_to_c1e = false;
15931595
}
1596+
1597+
/*
1598+
* By default, the C6 state assumes the worst-case scenario of package
1599+
* C6. However, if PC6 is disabled, we update the numbers to match
1600+
* core C6.
1601+
*/
1602+
rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr);
1603+
1604+
/* Limit value 2 and above allow for PC6. */
1605+
if ((msr & 0x7) < 2) {
1606+
spr_cstates[2].exit_latency = 190;
1607+
spr_cstates[2].target_residency = 600;
1608+
}
15941609
}
15951610

15961611
static bool __init intel_idle_verify_cstate(unsigned int mwait_hint)

0 commit comments

Comments
 (0)