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

Commit 6e7faf82 authored by Santosh Mardi's avatar Santosh Mardi
Browse files

devfreq: add use_ab tunnable



In some usecases AB votes may not be needed but governor
cannot suppress the AB measured on HW.

Provide use_ab tunable for userspace to drop AB vote.

Change-Id: Ib7734e06fa00f86eb536b63526c16212012b614d
Signed-off-by: default avatarSantosh Mardi <gsantosh@codeaurora.org>
parent 2b7e2162
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ struct hwmon_node {
	unsigned int hyst_trigger_count;
	unsigned int hyst_length;
	unsigned int idle_mbps;
	unsigned int use_ab;
	unsigned int mbps_zones[NUM_MBPS_ZONES];

	unsigned long prev_ab;
@@ -462,8 +463,10 @@ static unsigned long get_bw_and_set_irq(struct hwmon_node *node,
	}

	node->prev_ab = new_bw;
	if (ab)
	if (ab && node->use_ab)
		*ab = roundup(new_bw, node->bw_step);
	else if (ab)
		*ab = 0;

	*freq = (new_bw * 100) / io_percent;
	trace_bw_hwmon_update(dev_name(node->hw->df->dev.parent),
@@ -803,6 +806,7 @@ gov_attr(hist_memory, 0U, 90U);
gov_attr(hyst_trigger_count, 0U, 90U);
gov_attr(hyst_length, 0U, 90U);
gov_attr(idle_mbps, 0U, 2000U);
gov_attr(use_ab, 0U, 1U);
gov_list_attr(mbps_zones, NUM_MBPS_ZONES, 0U, UINT_MAX);

static struct attribute *dev_attr[] = {
@@ -819,6 +823,7 @@ static struct attribute *dev_attr[] = {
	&dev_attr_hyst_trigger_count.attr,
	&dev_attr_hyst_length.attr,
	&dev_attr_idle_mbps.attr,
	&dev_attr_use_ab.attr,
	&dev_attr_mbps_zones.attr,
	&dev_attr_throttle_adj.attr,
	NULL,
@@ -967,6 +972,7 @@ int register_bw_hwmon(struct device *dev, struct bw_hwmon *hwmon)
	node->hyst_trigger_count = 3;
	node->hyst_length = 0;
	node->idle_mbps = 400;
	node->use_ab = 1;
	node->mbps_zones[0] = 0;
	node->hw = hwmon;