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

Commit 4034cddd authored by Girish Mahadevan's avatar Girish Mahadevan Committed by Matt Wagantall
Browse files

msm: msm_bus: Add support for deferred QoS programming



Add support to defer QoS programming of bus master ports. Sometimes at
boot the required services to access QoS registers aren't ready, since
QoS programming is not catastrophic error defer this operation till the
a bandwidth request for that bus master port is received.

Change-Id: Ic0c9b23813f3c6e6ce13584f9a177c5fe0d0e49a
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent f9284300
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ struct msm_bus_node_info_type {
	uint32_t util_fact;
	uint32_t vrail_comp;
	uint32_t num_aggports;
	bool defer_qos;
};

struct msm_bus_node_device_type {
+12 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@
#include "msm_bus_noc.h"
#include "msm_bus_bimc.h"

static int msm_bus_dev_init_qos(struct device *dev, void *data);


ssize_t vrail_show(struct device *dev, struct device_attribute *attr,
			  char *buf)
{
@@ -434,6 +437,7 @@ int msm_bus_commit_data(int *dirty_nodes, int ctx, int num_dirty)
{
	int ret = 0;
	int i = 0;
	struct msm_bus_node_device_type *node_info;

	/* Aggregate the bus clocks */
	bus_for_each_dev(&msm_bus_type, NULL, (void *)&ctx,
@@ -450,6 +454,12 @@ int msm_bus_commit_data(int *dirty_nodes, int ctx, int num_dirty)
			continue;
		}

		node_info = node_device->platform_data;
		if (node_info) {
			if (unlikely(node_info->node_info->defer_qos))
				msm_bus_dev_init_qos(node_device, NULL);
		}

		ret = flush_bw_data(node_device, ctx);
		if (ret)
			MSM_BUS_ERR("%s: Error flushing bw data for node %d",
@@ -788,6 +798,7 @@ static int msm_bus_dev_init_qos(struct device *dev, void *data)
				if (ret < 0) {
					MSM_BUS_ERR("Can't Enable QoS clk %d",
					node_dev->node_info->id);
					node_dev->node_info->defer_qos = true;
					goto exit_init_qos;
				}

@@ -798,6 +809,7 @@ static int msm_bus_dev_init_qos(struct device *dev, void *data)
					bus_node_info->fabdev->qos_off,
					bus_node_info->fabdev->qos_freq);
				ret = msm_bus_disable_node_qos_clk(node_dev);
				node_dev->node_info->defer_qos = false;
			}
		} else
			MSM_BUS_ERR("%s: Skipping QOS init for %d",