[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200527192418.20169-1-sibis@codeaurora.org>
Date: Thu, 28 May 2020 00:54:18 +0530
From: Sibi Sankar <sibis@...eaurora.org>
To: viresh.kumar@...aro.org, sboyd@...nel.org, georgi.djakov@...aro.org
Cc: nm@...com, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
saravanak@...gle.com, mka@...omium.org, smasetty@...eaurora.org,
Sibi Sankar <sibis@...eaurora.org>
Subject: [PATCH] OPP: Check for bandwidth values before creating icc paths
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@...eaurora.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
Powered by blists - more mailing lists