Merge "drivers: dcvs: bwmon: add ab_scale"

This commit is contained in:
qctecmdr 2022-11-12 07:59:21 -08:00 committed by Gerrit - the friendly Code Review server
commit 8d66e1d64b
2 changed files with 9 additions and 1 deletions

View File

@ -277,6 +277,9 @@ static BWMON_ATTR_RW(hyst_length);
show_attr(idle_mbps);
store_attr(idle_mbps, 0U, 2000U);
static BWMON_ATTR_RW(idle_mbps);
show_attr(ab_scale);
store_attr(ab_scale, 0U, 100U);
static BWMON_ATTR_RW(ab_scale);
show_list_attr(mbps_zones, NUM_MBPS_ZONES);
store_list_attr(mbps_zones, NUM_MBPS_ZONES, 0U, UINT_MAX);
static BWMON_ATTR_RW(mbps_zones);
@ -299,6 +302,7 @@ static struct attribute *bwmon_attrs[] = {
&hyst_trigger_count.attr,
&hyst_length.attr,
&idle_mbps.attr,
&ab_scale.attr,
&mbps_zones.attr,
&throttle_adj.attr,
NULL,
@ -626,8 +630,10 @@ static unsigned long get_bw_and_set_irq(struct hwmon_node *node,
}
node->prev_ab = new_bw;
freq_mbps->ab = roundup(new_bw, node->bw_step);
freq_mbps->ib = (new_bw * 100) / io_percent;
if (node->ab_scale < 100)
new_bw = mult_frac(new_bw, node->ab_scale, 100);
freq_mbps->ab = roundup(new_bw, node->bw_step);
trace_bw_hwmon_update(dev_name(node->hw->dev),
freq_mbps->ab,
freq_mbps->ib,
@ -811,6 +817,7 @@ static int configure_hwmon_node(struct bw_hwmon *hwmon)
node->hyst_trigger_count = 3;
node->hyst_length = 0;
node->idle_mbps = 400;
node->ab_scale = 100;
node->mbps_zones[0] = 0;
node->hw = hwmon;

View File

@ -117,6 +117,7 @@ struct hwmon_node {
unsigned int hyst_trigger_count;
unsigned int hyst_length;
unsigned int idle_mbps;
unsigned int ab_scale;
unsigned int mbps_zones[NUM_MBPS_ZONES];
unsigned long prev_ab;
unsigned long bytes;