diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2022-06-16 22:16:04 +0200 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2022-10-11 21:28:42 +0200 |
commit | 3a911b8c2d97293f04288775599843ab5cb77045 (patch) | |
tree | f9483effcc443546d136510f19f3b89d1f04cae7 /target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch | |
parent | 5ad826f48a4f3c3e08bd1da8c1504a53edd281a0 (diff) | |
download | upstream-3a911b8c2d97293f04288775599843ab5cb77045.tar.gz upstream-3a911b8c2d97293f04288775599843ab5cb77045.tar.bz2 upstream-3a911b8c2d97293f04288775599843ab5cb77045.zip |
ipq806x: 5.15: backport devfreq new cpufreq based PASSIVE governor
Backport devfreq new cpufreq based PASSIVE governor needed for devfreq
based fab and cache scaling.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch')
-rw-r--r-- | target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch b/target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch new file mode 100644 index 0000000000..84cb67bc99 --- /dev/null +++ b/target/linux/ipq806x/patches-5.15/113-v5.19-02-PM-devfreq-Fix-kernel-panic-with-cpu-based-scaling-t.patch @@ -0,0 +1,39 @@ +From 57e00b40033a376de3f3cf0bb9bf7590d2dd679d Mon Sep 17 00:00:00 2001 +From: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com> +Date: Tue, 14 Jun 2022 13:06:59 +0200 +Subject: [PATCH 1/1] PM / devfreq: Fix kernel panic with cpu based scaling to + passive gov + +The cpufreq passive register notifier can PROBE_DEFER and the devfreq +struct is freed and then reallocaed on probe retry. +The current logic assume that the code can't PROBE_DEFER so the devfreq +struct in the this variable in devfreq_passive_data is assumed to be +(if already set) always correct. +This cause kernel panic as the code try to access the wrong address. +To correctly handle this, update the this variable in +devfreq_passive_data to the devfreq reallocated struct. + +Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") +Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com> +Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> +--- + drivers/devfreq/governor_passive.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c +index 72c67979ebe1..091a69e1f487 100644 +--- a/drivers/devfreq/governor_passive.c ++++ b/drivers/devfreq/governor_passive.c +@@ -407,8 +407,7 @@ static int devfreq_passive_event_handler(struct devfreq *devfreq, + if (!p_data) + return -EINVAL; + +- if (!p_data->this) +- p_data->this = devfreq; ++ p_data->this = devfreq; + + switch (event) { + case DEVFREQ_GOV_START: +-- +2.37.2 + |