summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2019-11-01 00:34:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-09 12:18:55 +0300
commit56f1c5108d674776bb493383ede28005edf41104 (patch)
tree39a21064f3a3e8db1edf7099ebe97b64f2c80b83
parent6b2c3bb311f3e7f90ede18adad0f5c153f67517b (diff)
downloadlinux-56f1c5108d674776bb493383ede28005edf41104.tar.xz
PM / devfreq: Set scaling_max_freq to max on OPP notifier error
[ Upstream commit e7cc792d00049c874010b398a27c3cc7bc8fef34 ] The devfreq_notifier_call functions will update scaling_min_freq and scaling_max_freq when the OPP table is updated. If fetching the maximum frequency fails then scaling_max_freq remains set to zero which is confusing. Set to ULONG_MAX instead so we don't need special handling for this case in other places. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/devfreq/devfreq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 34e297f28fc2..a47e76a62287 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -547,8 +547,10 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
goto out;
devfreq->scaling_max_freq = find_available_max_freq(devfreq);
- if (!devfreq->scaling_max_freq)
+ if (!devfreq->scaling_max_freq) {
+ devfreq->scaling_max_freq = ULONG_MAX;
goto out;
+ }
err = update_devfreq(devfreq);