All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OPP: Check for bandwidth values before creating icc paths
@ 2020-05-27 19:24 Sibi Sankar
  2020-05-29  5:20 ` Viresh Kumar
  0 siblings, 1 reply; 9+ messages in thread
From: Sibi Sankar @ 2020-05-27 19:24 UTC (permalink / raw)
  To: viresh.kumar, sboyd, georgi.djakov
  Cc: nm, linux-arm-msm, linux-kernel, linux-pm, saravanak, mka,
	smasetty, Sibi Sankar

Prevent the core from creating and voting on icc paths when the
opp-table does not have the bandwidth values populated. Currently
this check is performed on the first OPP node.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/opp/of.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 61fce1284f012..95cf6f1312765 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -338,6 +338,21 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
 	struct device_node *np;
 	int ret = 0, i, count, num_paths;
 	struct icc_path **paths;
+	struct property *prop;
+
+	/* Check for bandwidth values on the first OPP node */
+	if (opp_table && opp_table->np) {
+		np = of_get_next_available_child(opp_table->np, NULL);
+		if (!np) {
+			dev_err(dev, "Empty OPP table\n");
+			return 0;
+		}
+
+		prop = of_find_property(np, "opp-peak-kBps", NULL);
+		of_node_put(np);
+		if (!prop || !prop->length)
+			return 0;
+	}
 
 	np = of_node_get(dev->of_node);
 	if (!np)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-01 10:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 19:24 [PATCH] OPP: Check for bandwidth values before creating icc paths Sibi Sankar
2020-05-29  5:20 ` Viresh Kumar
2020-05-29 14:17   ` Sibi Sankar
2020-06-01  4:07     ` Viresh Kumar
2020-06-01  6:39       ` Sibi Sankar
2020-06-01  7:13         ` Viresh Kumar
2020-06-01 10:00           ` Sibi Sankar
2020-06-01 10:15             ` Viresh Kumar
2020-06-01 10:24               ` Sibi Sankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.