lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] OPP: Check for bandwidth values before creating icc paths
Date
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
\
 
 \ /
  Last update: 2020-05-27 21:25    [W:0.062 / U:1.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site