Skip to content

Commit a4501ba

Browse files
Rajendra Nayakvireshk
authored andcommitted
opp: Enable resources again if they were disabled earlier
dev_pm_opp_set_rate() can now be called with freq = 0 in order to either drop performance or bandwidth votes or to disable regulators on platforms which support them. In such cases, a subsequent call to dev_pm_opp_set_rate() with the same frequency ends up returning early because 'old_freq == freq' Instead make it fall through and put back the dropped performance and bandwidth votes and/or enable back the regulators. Cc: v5.3+ <[email protected]> # v5.3+ Fixes: cd7ea58 ("opp: Make dev_pm_opp_set_rate() handle freq = 0 to drop performance votes") Reported-by: Sajida Bhanu <[email protected]> Reviewed-by: Sibi Sankar <[email protected]> Reported-by: Matthias Kaehlcke <[email protected]> Tested-by: Matthias Kaehlcke <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Rajendra Nayak <[email protected]> [ Viresh: Don't skip clk_set_rate() and massaged changelog ] Signed-off-by: Viresh Kumar <[email protected]>
1 parent d4ec88d commit a4501ba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/opp/core.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,10 +934,13 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
934934

935935
/* Return early if nothing to do */
936936
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;
937+
if (!opp_table->required_opp_tables && !opp_table->regulators &&
938+
!opp_table->paths) {
939+
dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
940+
__func__, freq);
941+
ret = 0;
942+
goto put_opp_table;
943+
}
941944
}
942945

943946
/*

0 commit comments

Comments
 (0)