diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-03-01 00:58:57 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-05-07 07:05:16 +0200 |
commit | d53be2a2e98129ecf32009893ec46b1ce644721a (patch) | |
tree | a501ae76b98989a5c6b16762c185212c081b840b /target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch | |
parent | 861b82d36ae43efec8d16e61b82482e38996af92 (diff) | |
download | upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.tar.gz upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.tar.bz2 upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.zip |
ipq806x: copy kernel 5.4 patches to 5.10
Copy kernel 5.4 patches and config to 5.10
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch')
-rw-r--r-- | target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch b/target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch new file mode 100644 index 0000000000..8498a0b6df --- /dev/null +++ b/target/linux/ipq806x/patches-5.10/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch @@ -0,0 +1,47 @@ +From 4533c285c2aedce6d4434d7b877066de3b1ecb33 Mon Sep 17 00:00:00 2001 +From: Georgi Djakov <georgi.djakov@linaro.org> +Date: Thu, 25 Aug 2016 18:43:35 +0300 +Subject: [PATCH 52/69] PM / OPP: Update the voltage tolerance when adjusting + the OPP + +When the voltage is adjusted, the voltage tolerance is not updated. +This can lead to situations where the voltage min value is greater +than the voltage max value. The final result is triggering a BUG() +in the regulator core. +Fix this by updating the voltage tolerance values too. + +Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org> +--- + drivers/opp/core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/opp/core.c ++++ b/drivers/opp/core.c +@@ -2142,6 +2142,7 @@ int dev_pm_opp_adjust_voltage(struct dev + struct opp_table *opp_table; + struct dev_pm_opp *tmp_opp, *opp = ERR_PTR(-ENODEV); + int r = 0; ++ unsigned long tol; + + /* Find the opp_table */ + opp_table = _find_opp_table(dev); +@@ -2171,8 +2172,17 @@ int dev_pm_opp_adjust_voltage(struct dev + goto adjust_unlock; + + opp->supplies->u_volt = u_volt; +- opp->supplies->u_volt_min = u_volt_min; +- opp->supplies->u_volt_max = u_volt_max; ++ ++ tol = u_volt * opp_table->voltage_tolerance_v1 / 100; ++ if ( u_volt_min == u_volt ) ++ opp->supplies->u_volt_min = u_volt - tol; ++ else ++ opp->supplies->u_volt_min = u_volt_min; ++ ++ if ( u_volt_max == u_volt ) ++ opp->supplies->u_volt_max = u_volt + tol; ++ else ++ opp->supplies->u_volt_max = u_volt_max; + + dev_pm_opp_get(opp); + mutex_unlock(&opp_table->lock); |