summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/governor_userspace.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2018-08-03 22:05:10 +0200
committerMyungJoo Ham <myungjoo.ham@samsung.com>2018-10-02 03:16:41 +0200
commit6ff66e2a008337b8a005fd0ae2037bed716262cc (patch)
tree41850ac28462aec890606158d4c371f81f19bdbf /drivers/devfreq/governor_userspace.c
parentPM / devfreq: Fix handling of min/max_freq == 0 (diff)
downloadlinux-6ff66e2a008337b8a005fd0ae2037bed716262cc.tar.xz
linux-6ff66e2a008337b8a005fd0ae2037bed716262cc.zip
PM / devfreq: Don't adjust to user limits in governors
Several governors use the user space limits df->min/max_freq to adjust the target frequency. This is not necessary, since update_devfreq() already takes care of this. Instead the governor can request the available min/max frequency by setting the target frequency to DEVFREQ_MIN/MAX_FREQ and let update_devfreq() take care of any adjustments. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/governor_userspace.c')
-rw-r--r--drivers/devfreq/governor_userspace.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 080607c3f34d..378d84c011df 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -26,19 +26,11 @@ static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq)
{
struct userspace_data *data = df->data;
- if (data->valid) {
- unsigned long adjusted_freq = data->user_frequency;
-
- if (df->max_freq && adjusted_freq > df->max_freq)
- adjusted_freq = df->max_freq;
-
- if (df->min_freq && adjusted_freq < df->min_freq)
- adjusted_freq = df->min_freq;
-
- *freq = adjusted_freq;
- } else {
+ if (data->valid)
+ *freq = data->user_frequency;
+ else
*freq = df->previous_freq; /* No user freq specified yet */
- }
+
return 0;
}