PM / devfreq: make memlat and bwmon governors immutable

The devfreq devices that support the mem_latency, compute
or bw_hwmon governors are tightly coupled with hardware
monitors and are not expected to change governors at
runtime in normal operation. Thus, make these governors
immutable and have them start with min_freq equal to
max_freq to optimize performance during boot. Also make
the initial polling interval 500 ms to reduce polling
activity during boot.

Change-Id: Ida67f404155dce01facdfe999d8e71d9e1ac317c
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
This commit is contained in:
Amir Vajid 2020-06-30 15:47:25 -07:00
commit 116deac726
3 changed files with 14 additions and 1 deletions

View file

@ -220,7 +220,7 @@ int devfreq_add_icc(struct device *dev)
}
p = &d->dp;
p->polling_ms = 50;
p->polling_ms = 500;
p->target = icc_target;
p->get_dev_status = icc_get_dev_status;

View file

@ -616,6 +616,11 @@ static int gov_start(struct devfreq *df)
goto err_sysfs;
}
mutex_lock(&df->lock);
df->min_freq = df->max_freq;
update_devfreq(df);
mutex_unlock(&df->lock);
return 0;
err_sysfs:
@ -934,6 +939,7 @@ out:
static struct devfreq_governor devfreq_gov_bw_hwmon = {
.name = "bw_hwmon",
.immutable = 1,
.get_target_freq = devfreq_bw_hwmon_get_freq,
.event_handler = devfreq_bw_hwmon_ev_handler,
};

View file

@ -194,6 +194,11 @@ static int gov_start(struct devfreq *df)
if (ret < 0)
goto err_sysfs;
mutex_lock(&df->lock);
df->min_freq = df->max_freq;
update_devfreq(df);
mutex_unlock(&df->lock);
return 0;
err_sysfs:
@ -421,12 +426,14 @@ static int devfreq_memlat_ev_handler(struct devfreq *df,
static struct devfreq_governor devfreq_gov_memlat = {
.name = "mem_latency",
.immutable = 1,
.get_target_freq = devfreq_memlat_get_freq,
.event_handler = devfreq_memlat_ev_handler,
};
static struct devfreq_governor devfreq_gov_compute = {
.name = "compute",
.immutable = 1,
.get_target_freq = devfreq_memlat_get_freq,
.event_handler = devfreq_memlat_ev_handler,
};