Skip to content

Commit 65c0c23

Browse files
zhang-ruirafaeljw
authored andcommitted
intel_idle: Add AlderLake-N support
Similar to the other other AlderLake platforms, the C1 and C1E states on ADL-N are mutually exclusive. Only one of them can be enabled at a time. C1E is preferred on ADL-N for better energy efficiency. C6S is also supported on this platform. Its latency is far bigger than C6, but really close to C8 (PC8), thus it is not exposed as a separate state. Suggested-by: Baieswara Reddy Sagili <baieswara.reddy.sagili@intel.com> Suggested-by: Vinay Kumar <vinay.kumar@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 06f7c08 commit 65c0c23

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

drivers/idle/intel_idle.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,51 @@ static struct cpuidle_state adl_l_cstates[] __initdata = {
928928
.enter = NULL }
929929
};
930930

931+
static struct cpuidle_state adl_n_cstates[] __initdata = {
932+
{
933+
.name = "C1",
934+
.desc = "MWAIT 0x00",
935+
.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_UNUSABLE,
936+
.exit_latency = 1,
937+
.target_residency = 1,
938+
.enter = &intel_idle,
939+
.enter_s2idle = intel_idle_s2idle, },
940+
{
941+
.name = "C1E",
942+
.desc = "MWAIT 0x01",
943+
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
944+
.exit_latency = 2,
945+
.target_residency = 4,
946+
.enter = &intel_idle,
947+
.enter_s2idle = intel_idle_s2idle, },
948+
{
949+
.name = "C6",
950+
.desc = "MWAIT 0x20",
951+
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
952+
.exit_latency = 195,
953+
.target_residency = 585,
954+
.enter = &intel_idle,
955+
.enter_s2idle = intel_idle_s2idle, },
956+
{
957+
.name = "C8",
958+
.desc = "MWAIT 0x40",
959+
.flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
960+
.exit_latency = 260,
961+
.target_residency = 1040,
962+
.enter = &intel_idle,
963+
.enter_s2idle = intel_idle_s2idle, },
964+
{
965+
.name = "C10",
966+
.desc = "MWAIT 0x60",
967+
.flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,
968+
.exit_latency = 660,
969+
.target_residency = 1980,
970+
.enter = &intel_idle,
971+
.enter_s2idle = intel_idle_s2idle, },
972+
{
973+
.enter = NULL }
974+
};
975+
931976
static struct cpuidle_state spr_cstates[] __initdata = {
932977
{
933978
.name = "C1",
@@ -1309,6 +1354,10 @@ static const struct idle_cpu idle_cpu_adl_l __initconst = {
13091354
.state_table = adl_l_cstates,
13101355
};
13111356

1357+
static const struct idle_cpu idle_cpu_adl_n __initconst = {
1358+
.state_table = adl_n_cstates,
1359+
};
1360+
13121361
static const struct idle_cpu idle_cpu_spr __initconst = {
13131362
.state_table = spr_cstates,
13141363
.disable_promotion_to_c1e = true,
@@ -1379,6 +1428,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
13791428
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &idle_cpu_icx),
13801429
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, &idle_cpu_adl),
13811430
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, &idle_cpu_adl_l),
1431+
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_N, &idle_cpu_adl_n),
13821432
X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &idle_cpu_spr),
13831433
X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNL, &idle_cpu_knl),
13841434
X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNM, &idle_cpu_knl),
@@ -1816,6 +1866,7 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
18161866
break;
18171867
case INTEL_FAM6_ALDERLAKE:
18181868
case INTEL_FAM6_ALDERLAKE_L:
1869+
case INTEL_FAM6_ALDERLAKE_N:
18191870
adl_idle_state_table_update();
18201871
break;
18211872
}

0 commit comments

Comments
 (0)