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

Commit fb675a45 authored by Prudhvi Yarlagadda's avatar Prudhvi Yarlagadda Committed by Gerrit - the friendly Code Review server
Browse files

qcom-geni-se: correct the bandwidth aggregation logic



Current aggregation logic in geni driver doesn't take "agg ab"
into consideration to put bandwidth request to bus driver. This
is a issue if QUPv3 clock is not sufficient for multiple use
cases.

Correct the logic to include "agg ab" as well into
consideration to decide next bandwidth request. Increase the
bus bandwidth ranges.

Change-Id: I9de47a727574cfb69db479ccacdf2bdd18f753f4
Signed-off-by: default avatarPrudhvi Yarlagadda <pyarlaga@codeaurora.org>
parent 8b73d8d0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@

#define NUM_LOG_PAGES 2
#define MAX_CLK_PERF_LEVEL 32
static unsigned long default_bus_bw_set[] = {0, 19200000, 50000000, 100000000};
static unsigned long default_bus_bw_set[] = {0, 19200000, 50000000,
				100000000, 150000000, 200000000, 236000000};

/**
 * @struct geni_se_device - Data structure to represent the QUPv3 Core
@@ -622,8 +623,11 @@ static bool geni_se_check_bus_bw(struct geni_se_device *geni_se_dev)
	int new_bus_bw_idx = geni_se_dev->bus_bw_set_size - 1;
	unsigned long new_bus_bw;
	bool bus_bw_update = false;
	/* Convert agg ab into bytes per second */
	unsigned long new_ab_in_hz = DEFAULT_BUS_WIDTH *
					((2*geni_se_dev->cur_ab)*10000);

	new_bus_bw = max(geni_se_dev->cur_ib, geni_se_dev->cur_ab) /
	new_bus_bw = max(geni_se_dev->cur_ib, new_ab_in_hz) /
							DEFAULT_BUS_WIDTH;
	for (i = 0; i < geni_se_dev->bus_bw_set_size; i++) {
		if (geni_se_dev->bus_bw_set[i] >= new_bus_bw) {