]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
intel_idle: Remove the 'preferred_cstates' parameter
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 15 Dec 2025 11:13:00 +0000 (13:13 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Jan 2026 20:13:09 +0000 (21:13 +0100)
Remove the 'preferred_cstates' module parameter as it is not really useful.

The parameter currently only affects Alder Lake, where it controls C1/C1E
preference, with C1E being the default. The parameter does not support any
other platform. For example, Meteor Lake has a similar C1/C1E limitation,
but the parameter does not support Meteor Lake. This indicates that the
parameter is not very useful.

Generally, independent C1 and C1E are important for server platforms where
low latency is key. However, they are not as important for client platforms,
like Alder Lake, where C1E providing better energy savings is generally
preferred.

The parameter was originally introduced for Sapphire Rapids Xeon:
da0e58c038e6 intel_idle: add 'preferred_cstates' module argument

Later it was added to Alder Lake:
d1cf8bbfed1ed ("intel_idle: Add AlderLake support")

But it was removed from Sapphire Rapids when firmware fixed the C1/C1E
limitation:
1548fac47a114 ("intel_idle: make SPR C1 and C1E be independent")

So Alder Lake is the only platform left where this parameter has any effect.
Remove this parameter to simplify the driver and reduce maintenance burden.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://patch.msgid.link/20251215111300.132803-1-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/idle/intel_idle.c

index aa44b3c2cb2c4805dc9411171340c721cf7c9410..2d67a091ed3f0ef35caa68ea8c14b5f863229353 100644 (file)
@@ -70,7 +70,6 @@ static struct cpuidle_driver intel_idle_driver = {
 /* intel_idle.max_cstate=0 disables driver */
 static int max_cstate = CPUIDLE_STATE_MAX - 1;
 static unsigned int disabled_states_mask __read_mostly;
-static unsigned int preferred_states_mask __read_mostly;
 static bool force_irq_on __read_mostly;
 static bool ibrs_off __read_mostly;
 
@@ -2049,25 +2048,6 @@ static void __init skx_idle_state_table_update(void)
        }
 }
 
-/**
- * adl_idle_state_table_update - Adjust AlderLake idle states table.
- */
-static void __init adl_idle_state_table_update(void)
-{
-       /* Check if user prefers C1 over C1E. */
-       if (preferred_states_mask & BIT(1) && !(preferred_states_mask & BIT(2))) {
-               cpuidle_state_table[0].flags &= ~CPUIDLE_FLAG_UNUSABLE;
-               cpuidle_state_table[1].flags |= CPUIDLE_FLAG_UNUSABLE;
-
-               /* Disable C1E by clearing the "C1E promotion" bit. */
-               c1e_promotion = C1E_PROMOTION_DISABLE;
-               return;
-       }
-
-       /* Make sure C1E is enabled by default */
-       c1e_promotion = C1E_PROMOTION_ENABLE;
-}
-
 /**
  * spr_idle_state_table_update - Adjust Sapphire Rapids idle states table.
  */
@@ -2174,11 +2154,6 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
        case INTEL_EMERALDRAPIDS_X:
                spr_idle_state_table_update();
                break;
-       case INTEL_ALDERLAKE:
-       case INTEL_ALDERLAKE_L:
-       case INTEL_ATOM_GRACEMONT:
-               adl_idle_state_table_update();
-               break;
        case INTEL_ATOM_SILVERMONT:
        case INTEL_ATOM_AIRMONT:
                byt_cht_auto_demotion_disable();
@@ -2532,17 +2507,6 @@ module_param(max_cstate, int, 0444);
  */
 module_param_named(states_off, disabled_states_mask, uint, 0444);
 MODULE_PARM_DESC(states_off, "Mask of disabled idle states");
-/*
- * Some platforms come with mutually exclusive C-states, so that if one is
- * enabled, the other C-states must not be used. Example: C1 and C1E on
- * Sapphire Rapids platform. This parameter allows for selecting the
- * preferred C-states among the groups of mutually exclusive C-states - the
- * selected C-states will be registered, the other C-states from the mutually
- * exclusive group won't be registered. If the platform has no mutually
- * exclusive C-states, this parameter has no effect.
- */
-module_param_named(preferred_cstates, preferred_states_mask, uint, 0444);
-MODULE_PARM_DESC(preferred_cstates, "Mask of preferred idle states");
 /*
  * Debugging option that forces the driver to enter all C-states with
  * interrupts enabled. Does not apply to C-states with