lkml.org 
[lkml]   [2020]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 14/48] opp: Filter out OPPs based on availability of a required-OPP
Date
A required OPP may not be available, and thus, all OPPs which are using
this required OPP should be unavailable too.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/opp/core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index d9feb7639598..3d02fe33630b 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1588,7 +1588,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
struct opp_table *opp_table, bool rate_not_available)
{
struct list_head *head;
- int ret;
+ int i, ret;

mutex_lock(&opp_table->lock);
head = &opp_table->opp_list;
@@ -1615,6 +1615,15 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
__func__, new_opp->rate);
}

+ for (i = 0; i < opp_table->required_opp_count && new_opp->available; i++) {
+ if (new_opp->required_opps[i]->available)
+ continue;
+
+ new_opp->available = false;
+ dev_warn(dev, "%s: OPP not supported by required OPP %pOF (%lu)\n",
+ __func__, new_opp->required_opps[i]->np, new_opp->rate);
+ }
+
return 0;
}

--
2.29.2
\
 
 \ /
  Last update: 2020-12-17 19:17    [W:0.512 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site