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

Commit ca633475 authored by Girish Mahadevan's avatar Girish Mahadevan Committed by Gerrit - the friendly Code Review server
Browse files

msm: msm_bus: Arbitrate IB for dual config masters



Arbitrate the IBs on nodes marked as dual config. This will prevent cases
where the last client's requests is always used to apply dual config rules.

Change-Id: I06f9a16e5f32c1cda7a5d04a72a6e5cf7dc9fae6
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent af83c6c7
Loading
Loading
Loading
Loading
+25 −10
Original line number Diff line number Diff line
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2014, 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
@@ -297,6 +297,17 @@ static int getpath(int src, int dest)
	return CREATE_PNODE_ID(src, pnode_num);
}

static uint64_t get_node_maxib(struct msm_bus_inode_info *info)
{
	int i;
	uint64_t maxib = 0;

	for (i = 0; i <= info->num_pnodes; i++)
		maxib = max(*info->pnode[i].sel_clk, maxib);

	return maxib;
}

/**
 * update_path() - Update the path with the bandwidth and clock values, as
 * requested by the client.
@@ -344,15 +355,6 @@ static int update_path(int curr, int pnode, uint64_t req_clk, uint64_t req_bw,
		return -ENXIO;
	}

	/**
	 * If master supports dual configuration, check if
	 * the configuration needs to be changed based on
	 * incoming requests
	 */
	if (info->node_info->dual_conf)
		fabdev->algo->config_master(fabdev, info,
			req_clk, req_bw);

	info->link_info.sel_bw = &info->link_info.bw[ctx];
	info->link_info.sel_clk = &info->link_info.clk[ctx];
	*info->link_info.sel_bw += add_bw;
@@ -366,6 +368,19 @@ static int update_path(int curr, int pnode, uint64_t req_clk, uint64_t req_bw,
	info->pnode[index].sel_clk = &info->pnode[index].clk[ctx &
		cl_active_flag];
	*info->pnode[index].sel_bw += add_bw;
	*info->pnode[index].sel_clk = req_clk;

	/**
	 * If master supports dual configuration, check if
	 * the configuration needs to be changed based on
	 * incoming requests
	 */
	if (info->node_info->dual_conf) {
		uint64_t node_maxib = 0;
		node_maxib = get_node_maxib(info);
		fabdev->algo->config_master(fabdev, info,
			node_maxib, req_bw);
	}

	info->link_info.num_tiers = info->node_info->num_tiers;
	info->link_info.tier = info->node_info->tier;