Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 116deac7 authored by Amir Vajid's avatar Amir Vajid
Browse files

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: default avatarAmir Vajid <avajid@codeaurora.org>
parent 4027c201
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;

+6 −0
Original line number Diff line number Diff line
@@ -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 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,

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,
};
+7 −0
Original line number Diff line number Diff line
@@ -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,
};