summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-08-23 13:51:30 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-08-23 13:51:30 +0200
commit1f8b66d9654b21ec227a7884bcf739c70d9d27a7 (patch)
tree1b93418c4e097af9137c6435450d6d6cec35d2f8
parente22ce8eb631bdc47a4a4ea7ecf4e4ba499db4f93 (diff)
parent19526d092ceb32d619fce73fe0bdca4370890124 (diff)
Merge branch 'opp/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm into pm-opp
Pull regression fix for the operating performance points (OPP) framework for v5.15 from Viresh Kumar: "This fixes regression in the OPP core for a corner case." * 'opp/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: opp: core: Check for pending links before reading required_opp pointers
-rw-r--r--drivers/opp/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 5543c54dacc5..04b4691a8aac 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -893,6 +893,10 @@ static int _set_required_opps(struct device *dev,
if (!required_opp_tables)
return 0;
+ /* required-opps not fully initialized yet */
+ if (lazy_linking_pending(opp_table))
+ return -EBUSY;
+
/*
* We only support genpd's OPPs in the "required-opps" for now, as we
* don't know much about other use cases. Error out if the required OPP
@@ -903,10 +907,6 @@ static int _set_required_opps(struct device *dev,
return -ENOENT;
}
- /* required-opps not fully initialized yet */
- if (lazy_linking_pending(opp_table))
- return -EBUSY;
-
/* Single genpd case */
if (!genpd_virt_devs)
return _set_required_opp(dev, dev, opp, 0);