]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM / devfreq: Set scaling_max_freq to max on OPP notifier error
authorLeonard Crestez <leonard.crestez@nxp.com>
Thu, 31 Oct 2019 21:34:19 +0000 (23:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:18:55 +0000 (10:18 +0100)
[ 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>
drivers/devfreq/devfreq.c

index 34e297f28fc2ad09c212de569a865a7eaf74f2f2..a47e76a62287f7d079cc79a1b44fd1851947b7d8 100644 (file)
@@ -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);