Skip to contentSkip to conversation

FAILED: patch "[PATCH] Revert "cpufreq: governor: Fix negative idle_time when" failed to apply to 4.5-stable tree

PATCH [email protected] 1 participant 1 message May 1, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.5-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 94862a62dfe3ba1c7601115a2dc80721c5b256f0 Mon Sep 17 00:00:00 2001

From: "Rafael J. Wysocki" <[email protected]>
Date: Thu, 21 Apr 2016 20:57:47 +0200
Subject: [PATCH] Revert "cpufreq: governor: Fix negative idle_time when
configured with CONFIG_HZ_PERIODIC"

Revert commit 0df35026c6a5 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC) that introduced a regression by causing the ondemand cpufreq governor to misbehave for CONFIG_TICK_CPU_ACCOUNTING unset (the frequency goes up to the max at one point and stays there indefinitely).

The revert takes subsequent modifications of the code in question into account.

Fixes 0df35026c6a5 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
Reported-and-tested-by Timo Valtoaho <[email protected]>
Cc 4.5+ <[email protected]> # 4.5+
drivers/cpufreq/cpufreq_governor.c +2 -6
index 10a5cfeae8c5..5f1147fa9239 100644
@@ -193,12 +193,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
 		wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
 		j_cdbs->prev_cpu_wall = cur_wall_time;
 
-		if (cur_idle_time <= j_cdbs->prev_cpu_idle) {
-			idle_time = 0;
-		} else {
-			idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
-			j_cdbs->prev_cpu_idle = cur_idle_time;
-		}
+		idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
+		j_cdbs->prev_cpu_idle = cur_idle_time;
 
 		if (ignore_nice) {
 			u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];