diff mbox series

[1/4] intel_idle: refactor and split out model specific fixups into its own function

Message ID 20230717151856.2529029-1-arjan@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show
Series [1/4] intel_idle: refactor and split out model specific fixups into its own function | expand

Commit Message

Arjan van de Ven July 17, 2023, 3:18 p.m. UTC
From: Arjan van de Ven <arjan@linux.intel.com>

As this list has been growing over time, lets split it into its own function.
That also makes it possible to move other hw workarounds into this function over time.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 drivers/idle/intel_idle.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Rafael J. Wysocki July 19, 2023, 6:28 p.m. UTC | #1
On Mon, Jul 17, 2023 at 5:19 PM <arjan@linux.intel.com> wrote:
>
> From: Arjan van de Ven <arjan@linux.intel.com>
>
> As this list has been growing over time, lets split it into its own function.
> That also makes it possible to move other hw workarounds into this function over time.
>
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

After a discussion with Peter I have decided to revert the original
changes, sorry about that.

IMV Peter has a point regarding the lack of data supporting the
claimed performance gain and without the umwait part they are rather
hard to defend.

> ---
>  drivers/idle/intel_idle.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index b930036edbbe..3bab6500697a 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -1955,10 +1955,8 @@ static bool should_verify_mwait(struct cpuidle_state *state)
>         return true;
>  }
>
> -static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
> +static void __init model_specific_fixups(void)
>  {
> -       int cstate;
> -
>         switch (boot_cpu_data.x86_model) {
>         case INTEL_FAM6_IVYBRIDGE_X:
>                 ivt_idle_state_table_update();
> @@ -1983,6 +1981,13 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
>                 adl_idle_state_table_update();
>                 break;
>         }
> +}
> +
> +static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
> +{
> +       int cstate;
> +
> +       model_specific_fixups();
>
>         for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
>                 struct cpuidle_state *state;
> --
> 2.41.0
>
diff mbox series

Patch

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b930036edbbe..3bab6500697a 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1955,10 +1955,8 @@  static bool should_verify_mwait(struct cpuidle_state *state)
 	return true;
 }
 
-static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
+static void __init model_specific_fixups(void)
 {
-	int cstate;
-
 	switch (boot_cpu_data.x86_model) {
 	case INTEL_FAM6_IVYBRIDGE_X:
 		ivt_idle_state_table_update();
@@ -1983,6 +1981,13 @@  static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
 		adl_idle_state_table_update();
 		break;
 	}
+}
+
+static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
+{
+	int cstate;
+
+	model_specific_fixups();
 
 	for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
 		struct cpuidle_state *state;