[PATCH] intel_idle: fix C1E handling for AlderLake

From: Zhang Rui
Date: Wed Apr 27 2022 - 21:37:10 EST


commit cc6e234b8264 ("intel_idle: Add AlderLake support") disables the C1E
promotion using the 'disable_promotion_to_c1e' variable, but enables the
the C1E promotion by invoking c1e_promotion_enable() directly.

Then, commit 39c184a6a9a7 ("intel_idle: Fix the 'preferred_cstates' module
parameter") removes the 'disable_promotion_to_c1e' variable and introduces
a new tri-state 'c1e_promotion' variable that can be used for both
enabling and disabling C1E promotion, on a per CPU basis.

Switch to use the new 'c1e_promotion' variable to fix the build failure,
and also to do C1E promotion bit update on all CPUs.

Fixes: commit cc6e234b8264 ("intel_idle: Add AlderLake support")
Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
drivers/idle/intel_idle.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 7c081ed26b64..2de6e0a2d9a1 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1698,12 +1698,12 @@ static void __init adl_idle_state_table_update(void)
cpuidle_state_table[1].flags |= CPUIDLE_FLAG_UNUSABLE;

/* Disable C1E by clearing the "C1E promotion" bit. */
- disable_promotion_to_c1e = true;
+ c1e_promotion = C1E_PROMOTION_DISABLE;
return;
}
end:
/* Make sure C1E is enabled by default */
- c1e_promotion_enable();
+ c1e_promotion = C1E_PROMOTION_ENABLE;
}

/**
--
2.17.1