summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2018-06-09 16:13:40 +0200
committerJohn Crispin <john@phrozen.org>2018-06-19 12:54:24 +0200
commit637d10d91e3677c84b678485c2a19a2a9aacf0f0 (patch)
tree6953c884c71119b9b1ce6389e1ea53d9d79845dc
parent747600e93c20f71ca249f8dc2a58b9ba4c658585 (diff)
downloadmtk-20170518-637d10d91e3677c84b678485c2a19a2a9aacf0f0.zip
mtk-20170518-637d10d91e3677c84b678485c2a19a2a9aacf0f0.tar.gz
mtk-20170518-637d10d91e3677c84b678485c2a19a2a9aacf0f0.tar.bz2
mvebu: add fix for armada 37xx cpufreq driver
Backport from stable kernel tree fixing clock leak. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> (cherry picked from commit 4ec8c8c23ed50dbe9cabbfc544ae2780f0287fd0)
-rw-r--r--target/linux/mvebu/patches-4.14/508-cpufreq-armada-37xx-Fix-clock-leak.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-4.14/508-cpufreq-armada-37xx-Fix-clock-leak.patch b/target/linux/mvebu/patches-4.14/508-cpufreq-armada-37xx-Fix-clock-leak.patch
new file mode 100644
index 0000000..7479c6d
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/508-cpufreq-armada-37xx-Fix-clock-leak.patch
@@ -0,0 +1,35 @@
+From bbcc328561040292f7d6796954d478e4a2335e6f Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement@bootlin.com>
+Date: Wed, 4 Apr 2018 16:44:44 +0200
+Subject: [PATCH] cpufreq: armada-37xx: Fix clock leak
+
+There was no clk_put() balancing the clk_get(). This commit fixes it.
+
+Fixes: 92ce45fb875d (cpufreq: Add DVFS support for Armada 37xx)
+Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
+Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+---
+ drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/cpufreq/armada-37xx-cpufreq.c
++++ b/drivers/cpufreq/armada-37xx-cpufreq.c
+@@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_dri
+ cur_frequency = clk_get_rate(clk);
+ if (!cur_frequency) {
+ dev_err(cpu_dev, "Failed to get clock rate for CPU\n");
++ clk_put(clk);
+ return -EINVAL;
+ }
+
+@@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_dri
+ return -EINVAL;
+
+ armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider);
++ clk_put(clk);
+
+ for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR;
+ load_lvl++) {