From: Greg Kroah-Hartman Date: Tue, 7 Mar 2023 12:37:04 +0000 (+0100) Subject: drop powerclamp patch from 4.14 and 4.19 X-Git-Tag: v6.2.3~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4589cc42918b0e8ccbdf4f9cf0b6a3619b785f72;p=thirdparty%2Fkernel%2Fstable-queue.git drop powerclamp patch from 4.14 and 4.19 --- diff --git a/queue-4.14/series b/queue-4.14/series index bb274faf13e..11b51f70df5 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -131,7 +131,6 @@ ext4-refuse-to-create-ea-block-when-umounted.patch ext4-fix-possible-corruption-when-moving-a-directory.patch wifi-rtl8xxxu-use-a-longer-retry-limit-of-48.patch wifi-cfg80211-fix-use-after-free-for-wext.patch -thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch dm-flakey-fix-logic-when-corrupting-a-bio.patch dm-flakey-don-t-corrupt-the-zero-page.patch arm-dts-exynos-correct-tmu-phandle-in-exynos4.patch diff --git a/queue-4.14/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch b/queue-4.14/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch deleted file mode 100644 index 14d9a30b12a..00000000000 --- a/queue-4.14/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 8e47363588377e1bdb65e2b020b409cfb44dd260 Mon Sep 17 00:00:00 2001 -From: Srinivas Pandruvada -Date: Wed, 1 Feb 2023 12:39:41 -0800 -Subject: thermal: intel: powerclamp: Fix cur_state for multi package system - -From: Srinivas Pandruvada - -commit 8e47363588377e1bdb65e2b020b409cfb44dd260 upstream. - -The powerclamp cooling device cur_state shows actual idle observed by -package C-state idle counters. But the implementation is not sufficient -for multi package or multi die system. The cur_state value is incorrect. -On these systems, these counters must be read from each package/die and -somehow aggregate them. But there is no good method for aggregation. - -It was not a problem when explicit CPU model addition was required to -enable intel powerclamp. In this way certain CPU models could have -been avoided. But with the removal of CPU model check with the -availability of Package C-state counters, the driver is loaded on most -of the recent systems. - -For multi package/die systems, just show the actual target idle state, -the system is trying to achieve. In powerclamp this is the user set -state minus one. - -Also there is no use of starting a worker thread for polling package -C-state counters and applying any compensation for multiple package -or multiple die systems. - -Fixes: b721ca0d1927 ("thermal/powerclamp: remove cpu whitelist") -Signed-off-by: Srinivas Pandruvada -Cc: 4.14+ # 4.14+ -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Greg Kroah-Hartman ---- - drivers/thermal/intel_powerclamp.c | 20 ++++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - ---- a/drivers/thermal/intel_powerclamp.c -+++ b/drivers/thermal/intel_powerclamp.c -@@ -72,6 +72,7 @@ - - static unsigned int target_mwait; - static struct dentry *debug_dir; -+static bool poll_pkg_cstate_enable; - - /* user selected target */ - static unsigned int set_target_ratio; -@@ -280,6 +281,9 @@ static unsigned int get_compensation(int - { - unsigned int comp = 0; - -+ if (!poll_pkg_cstate_enable) -+ return 0; -+ - /* we only use compensation if all adjacent ones are good */ - if (ratio == 1 && - cal_data[ratio].confidence >= CONFIDENCE_OK && -@@ -552,7 +556,8 @@ static int start_power_clamp(void) - control_cpu = cpumask_first(cpu_online_mask); - - clamping = true; -- schedule_delayed_work(&poll_pkg_cstate_work, 0); -+ if (poll_pkg_cstate_enable) -+ schedule_delayed_work(&poll_pkg_cstate_work, 0); - - /* start one kthread worker per online cpu */ - for_each_online_cpu(cpu) { -@@ -621,11 +626,15 @@ static int powerclamp_get_max_state(stru - static int powerclamp_get_cur_state(struct thermal_cooling_device *cdev, - unsigned long *state) - { -- if (true == clamping) -- *state = pkg_cstate_ratio_cur; -- else -+ if (clamping) { -+ if (poll_pkg_cstate_enable) -+ *state = pkg_cstate_ratio_cur; -+ else -+ *state = set_target_ratio; -+ } else { - /* to save power, do not poll idle ratio while not clamping */ - *state = -1; /* indicates invalid state */ -+ } - - return 0; - } -@@ -770,6 +779,9 @@ static int __init powerclamp_init(void) - goto exit_unregister; - } - -+ if (topology_max_packages() == 1 && topology_max_die_per_package() == 1) -+ poll_pkg_cstate_enable = true; -+ - cooling_dev = thermal_cooling_device_register("intel_powerclamp", NULL, - &powerclamp_cooling_ops); - if (IS_ERR(cooling_dev)) { diff --git a/queue-4.19/series b/queue-4.19/series index 100e47e9835..f3b801708d8 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -175,7 +175,6 @@ ext4-refuse-to-create-ea-block-when-umounted.patch ext4-fix-possible-corruption-when-moving-a-directory.patch wifi-rtl8xxxu-use-a-longer-retry-limit-of-48.patch wifi-cfg80211-fix-use-after-free-for-wext.patch -thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch dm-flakey-fix-logic-when-corrupting-a-bio.patch dm-flakey-don-t-corrupt-the-zero-page.patch arm-dts-exynos-correct-tmu-phandle-in-exynos4.patch diff --git a/queue-4.19/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch b/queue-4.19/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch deleted file mode 100644 index 14d9a30b12a..00000000000 --- a/queue-4.19/thermal-intel-powerclamp-fix-cur_state-for-multi-package-system.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 8e47363588377e1bdb65e2b020b409cfb44dd260 Mon Sep 17 00:00:00 2001 -From: Srinivas Pandruvada -Date: Wed, 1 Feb 2023 12:39:41 -0800 -Subject: thermal: intel: powerclamp: Fix cur_state for multi package system - -From: Srinivas Pandruvada - -commit 8e47363588377e1bdb65e2b020b409cfb44dd260 upstream. - -The powerclamp cooling device cur_state shows actual idle observed by -package C-state idle counters. But the implementation is not sufficient -for multi package or multi die system. The cur_state value is incorrect. -On these systems, these counters must be read from each package/die and -somehow aggregate them. But there is no good method for aggregation. - -It was not a problem when explicit CPU model addition was required to -enable intel powerclamp. In this way certain CPU models could have -been avoided. But with the removal of CPU model check with the -availability of Package C-state counters, the driver is loaded on most -of the recent systems. - -For multi package/die systems, just show the actual target idle state, -the system is trying to achieve. In powerclamp this is the user set -state minus one. - -Also there is no use of starting a worker thread for polling package -C-state counters and applying any compensation for multiple package -or multiple die systems. - -Fixes: b721ca0d1927 ("thermal/powerclamp: remove cpu whitelist") -Signed-off-by: Srinivas Pandruvada -Cc: 4.14+ # 4.14+ -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Greg Kroah-Hartman ---- - drivers/thermal/intel_powerclamp.c | 20 ++++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - ---- a/drivers/thermal/intel_powerclamp.c -+++ b/drivers/thermal/intel_powerclamp.c -@@ -72,6 +72,7 @@ - - static unsigned int target_mwait; - static struct dentry *debug_dir; -+static bool poll_pkg_cstate_enable; - - /* user selected target */ - static unsigned int set_target_ratio; -@@ -280,6 +281,9 @@ static unsigned int get_compensation(int - { - unsigned int comp = 0; - -+ if (!poll_pkg_cstate_enable) -+ return 0; -+ - /* we only use compensation if all adjacent ones are good */ - if (ratio == 1 && - cal_data[ratio].confidence >= CONFIDENCE_OK && -@@ -552,7 +556,8 @@ static int start_power_clamp(void) - control_cpu = cpumask_first(cpu_online_mask); - - clamping = true; -- schedule_delayed_work(&poll_pkg_cstate_work, 0); -+ if (poll_pkg_cstate_enable) -+ schedule_delayed_work(&poll_pkg_cstate_work, 0); - - /* start one kthread worker per online cpu */ - for_each_online_cpu(cpu) { -@@ -621,11 +626,15 @@ static int powerclamp_get_max_state(stru - static int powerclamp_get_cur_state(struct thermal_cooling_device *cdev, - unsigned long *state) - { -- if (true == clamping) -- *state = pkg_cstate_ratio_cur; -- else -+ if (clamping) { -+ if (poll_pkg_cstate_enable) -+ *state = pkg_cstate_ratio_cur; -+ else -+ *state = set_target_ratio; -+ } else { - /* to save power, do not poll idle ratio while not clamping */ - *state = -1; /* indicates invalid state */ -+ } - - return 0; - } -@@ -770,6 +779,9 @@ static int __init powerclamp_init(void) - goto exit_unregister; - } - -+ if (topology_max_packages() == 1 && topology_max_die_per_package() == 1) -+ poll_pkg_cstate_enable = true; -+ - cooling_dev = thermal_cooling_device_register("intel_powerclamp", NULL, - &powerclamp_cooling_ops); - if (IS_ERR(cooling_dev)) {