]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Aug 2020 12:06:34 +0000 (14:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Aug 2020 12:06:34 +0000 (14:06 +0200)
added patches:
cpufreq-dt-fix-oops-on-armada37xx.patch

queue-4.19/cpufreq-dt-fix-oops-on-armada37xx.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/cpufreq-dt-fix-oops-on-armada37xx.patch b/queue-4.19/cpufreq-dt-fix-oops-on-armada37xx.patch
new file mode 100644 (file)
index 0000000..7b901b2
--- /dev/null
@@ -0,0 +1,48 @@
+From 10470dec3decaf5ed3c596f85debd7c42777ae12 Mon Sep 17 00:00:00 2001
+From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+Date: Sat, 20 Jun 2020 17:44:49 +0100
+Subject: cpufreq: dt: fix oops on armada37xx
+
+From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+
+commit 10470dec3decaf5ed3c596f85debd7c42777ae12 upstream.
+
+Commit 0c868627e617e43a295d8 (cpufreq: dt: Allow platform specific
+intermediate callbacks) added two function pointers to the
+struct cpufreq_dt_platform_data. However, armada37xx_cpufreq_driver_init()
+has this struct (pdata) located on the stack and uses only "suspend"
+and "resume" fields. So these newly added "get_intermediate" and
+"target_intermediate" pointers are uninitialized and contain arbitrary
+non-null values, causing all kinds of trouble.
+
+For instance, here is an oops on espressobin after an attempt to change
+the cpefreq governor:
+
+[   29.174554] Unable to handle kernel execute from non-executable memory at virtual address ffff00003f87bdc0
+...
+[   29.269373] pc : 0xffff00003f87bdc0
+[   29.272957] lr : __cpufreq_driver_target+0x138/0x580
+...
+
+Fixed by zeroing out pdata before use.
+
+Cc: <stable@vger.kernel.org> # v5.7+
+Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/armada-37xx-cpufreq.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/cpufreq/armada-37xx-cpufreq.c
++++ b/drivers/cpufreq/armada-37xx-cpufreq.c
+@@ -458,6 +458,7 @@ static int __init armada37xx_cpufreq_dri
+       /* Now that everything is setup, enable the DVFS at hardware level */
+       armada37xx_cpufreq_enable_dvfs(nb_pm_base);
++      memset(&pdata, 0, sizeof(pdata));
+       pdata.suspend = armada37xx_cpufreq_suspend;
+       pdata.resume = armada37xx_cpufreq_resume;
index 45b690f8dcd57b54754d257884a14359cbfc58df..bddad772b73dc5a0c9cf5845b9feb797796a8f44 100644 (file)
@@ -155,3 +155,4 @@ alsa-usb-audio-add-quirk-for-pioneer-ddj-rb.patch
 drm-ttm-nouveau-don-t-call-tt-destroy-callback-on-alloc-failure.patch
 nfs-don-t-move-layouts-to-plh_return_segs-list-while-in-use.patch
 nfs-don-t-return-layout-segments-that-are-in-use.patch
+cpufreq-dt-fix-oops-on-armada37xx.patch