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

Commit ac4f4341 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom-geni-se: correct the bandwidth aggregation logic"

parents 2f1ae931 666664cf
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -41,7 +41,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
@@ -630,8 +631,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) {