Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+12 -7
+12 -7
drivers/opp/core.c
··· 893 893 * have OPP table for the device, while others don't and 894 894 * opp_set_rate() just needs to behave like clk_set_rate(). 895 895 */ 896 - if (!_get_opp_count(opp_table)) 897 - return 0; 896 + if (!_get_opp_count(opp_table)) { 897 + ret = 0; 898 + goto put_opp_table; 899 + } 898 900 899 901 if (!opp_table->required_opp_tables && !opp_table->regulators && 900 902 !opp_table->paths) { ··· 907 905 908 906 ret = _set_opp_bw(opp_table, NULL, dev, true); 909 907 if (ret) 910 - return ret; 908 + goto put_opp_table; 911 909 912 910 if (opp_table->regulator_enabled) { 913 911 regulator_disable(opp_table->regulators[0]); ··· 934 932 935 933 /* Return early if nothing to do */ 936 934 if (old_freq == freq) { 937 - dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n", 938 - __func__, freq); 939 - ret = 0; 940 - goto put_opp_table; 935 + if (!opp_table->required_opp_tables && !opp_table->regulators && 936 + !opp_table->paths) { 937 + dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n", 938 + __func__, freq); 939 + ret = 0; 940 + goto put_opp_table; 941 + } 941 942 } 942 943 943 944 /*