Power management fixes for 5.9-rc2

- Fix re-enabling of resources in dev_pm_opp_set_rate() (Rajendra
    Nayak).
 
  - Fix OPP table reference counting in error paths (Stephen Boyd).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl9AC7oSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxW2AP+gN4h8yIpyn9G0HSEv8zUPy+CwOSOL5U
 Mrzcoln2eBj9MGE+Pny5JcOUTRcdpBtN0k/0/OfZMNwKm228eWlkcolG/HeRWY2K
 AjE3a80drxjqBxsaoJraGgK8KjbtfZGJzV2iFrBNU9LPr0deuJ83CKTTa07YyefM
 gKMijLQDWzxKMsvnE1ZlPzuPPruQjsN0h+NjXZiEkdovQWZuQyiKNmUDS/L78o4o
 eDP8g3z7FOz21KBytzO2QikSXzqX2cPQw2Ydbry9mRGBZxJ8woyCxj1jsxjv22IK
 YiTJKnZAlLKaGF2X1r1PO9Ccu4Js6MGgeWKhHAUBpI4dT4ssVybJmzl1iI4Um5EH
 39JJ07dClt+INsvhLQ6VoTQkpP4kds+yJVGdkhUyinxWXkMAt3ibEqeKqFmUu7Cb
 t0+sPkJYFmLkfNL81/E1thrXk/sEZ0ixA5Nlg49Gk+fSv6riG6bugpnJEEKYpFb8
 5rqWQKKcVp4p1IrrVbSaaqPRCvvfu3Zk3LZc4ycYsVPPVng6+PvFgGLlBHxK1ath
 m0F2kY6WJA0MrA4JeQCQ7Jpgt4TiIa+DPzFu1OD3tWBms1IF3DGd2HSAlaz4EI1i
 Ad0ozgXIhwnYIh6EbWfjSBiwkOK4cltpZG0cD0rNYHl/S1e46BbYCHow1i2h4x/u
 P/fVdxK6zVeE
 =7DWg
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix a few issues in the operating performance points (OPP)
  framework.

  Specifics:

   - Fix re-enabling of resources in dev_pm_opp_set_rate() (Rajendra
     Nayak)

   - Fix OPP table reference counting in error paths (Stephen Boyd)"

* tag 'pm-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  opp: Enable resources again if they were disabled earlier
  opp: Put opp table in dev_pm_opp_set_rate() if _set_opp_bw() fails
  opp: Put opp table in dev_pm_opp_set_rate() for empty tables
This commit is contained in:
Linus Torvalds 2020-08-21 12:26:58 -07:00
commit 985c788b6d
1 changed files with 12 additions and 7 deletions

View File

@ -893,8 +893,10 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
* have OPP table for the device, while others don't and
* opp_set_rate() just needs to behave like clk_set_rate().
*/
if (!_get_opp_count(opp_table))
return 0;
if (!_get_opp_count(opp_table)) {
ret = 0;
goto put_opp_table;
}
if (!opp_table->required_opp_tables && !opp_table->regulators &&
!opp_table->paths) {
@ -905,7 +907,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
ret = _set_opp_bw(opp_table, NULL, dev, true);
if (ret)
return ret;
goto put_opp_table;
if (opp_table->regulator_enabled) {
regulator_disable(opp_table->regulators[0]);
@ -932,10 +934,13 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
/* Return early if nothing to do */
if (old_freq == freq) {
dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
__func__, freq);
ret = 0;
goto put_opp_table;
if (!opp_table->required_opp_tables && !opp_table->regulators &&
!opp_table->paths) {
dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
__func__, freq);
ret = 0;
goto put_opp_table;
}
}
/*