Commit 2125a725 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pmdomain-v6.11-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fix from Ulf Hansson:

 - Fix support for required OPPs for multiple PM domains

* tag 'pmdomain-v6.11-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  OPP: Fix support for required OPPs for multiple PM domains
parents 8654fa5c 9ec87c59
...@@ -1061,6 +1061,27 @@ static int _set_opp_bw(const struct opp_table *opp_table, ...@@ -1061,6 +1061,27 @@ static int _set_opp_bw(const struct opp_table *opp_table,
return 0; return 0;
} }
static int _set_opp_level(struct device *dev, struct dev_pm_opp *opp)
{
unsigned int level = 0;
int ret = 0;
if (opp) {
if (opp->level == OPP_LEVEL_UNSET)
return 0;
level = opp->level;
}
/* Request a new performance state through the device's PM domain. */
ret = dev_pm_domain_set_performance_state(dev, level);
if (ret)
dev_err(dev, "Failed to set performance state %u (%d)\n", level,
ret);
return ret;
}
/* This is only called for PM domain for now */ /* This is only called for PM domain for now */
static int _set_required_opps(struct device *dev, struct opp_table *opp_table, static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
struct dev_pm_opp *opp, bool up) struct dev_pm_opp *opp, bool up)
...@@ -1091,7 +1112,7 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table, ...@@ -1091,7 +1112,7 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
if (devs[index]) { if (devs[index]) {
required_opp = opp ? opp->required_opps[index] : NULL; required_opp = opp ? opp->required_opps[index] : NULL;
ret = dev_pm_opp_set_opp(devs[index], required_opp); ret = _set_opp_level(devs[index], required_opp);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -1102,27 +1123,6 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table, ...@@ -1102,27 +1123,6 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
return 0; return 0;
} }
static int _set_opp_level(struct device *dev, struct dev_pm_opp *opp)
{
unsigned int level = 0;
int ret = 0;
if (opp) {
if (opp->level == OPP_LEVEL_UNSET)
return 0;
level = opp->level;
}
/* Request a new performance state through the device's PM domain. */
ret = dev_pm_domain_set_performance_state(dev, level);
if (ret)
dev_err(dev, "Failed to set performance state %u (%d)\n", level,
ret);
return ret;
}
static void _find_current_opp(struct device *dev, struct opp_table *opp_table) static void _find_current_opp(struct device *dev, struct opp_table *opp_table)
{ {
struct dev_pm_opp *opp = ERR_PTR(-ENODEV); struct dev_pm_opp *opp = ERR_PTR(-ENODEV);
...@@ -2457,18 +2457,6 @@ static int _opp_attach_genpd(struct opp_table *opp_table, struct device *dev, ...@@ -2457,18 +2457,6 @@ static int _opp_attach_genpd(struct opp_table *opp_table, struct device *dev,
} }
} }
/*
* Add the virtual genpd device as a user of the OPP table, so
* we can call dev_pm_opp_set_opp() on it directly.
*
* This will be automatically removed when the OPP table is
* removed, don't need to handle that here.
*/
if (!_add_opp_dev(virt_dev, opp_table->required_opp_tables[index])) {
ret = -ENOMEM;
goto err;
}
opp_table->required_devs[index] = virt_dev; opp_table->required_devs[index] = virt_dev;
index++; index++;
name++; name++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment