PM / devfreq: Fix cpufreq passive unregister erroring on PROBE_DEFER
authorChristian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Tue, 14 Jun 2022 23:09:47 +0000 (01:09 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 29 Jun 2022 20:11:17 +0000 (05:11 +0900)
commit0cca7e8dcfa9e6fe7ba697e534a732571f1689d0
tree564c95082d52fe7e96a7533054fd41620a6f5636
parente52b045fe07d7874474665c843befa7521853234
PM / devfreq: Fix cpufreq passive unregister erroring on PROBE_DEFER

With the passive governor, the cpu based scaling can PROBE_DEFER due to
the fact that CPU policy are not ready.
The cpufreq passive unregister notifier is called both from the
GOV_START errors and for the GOV_STOP and assume the notifier is
successfully registred every time. With GOV_START failing it's wrong to
loop over each possible CPU since the register path has failed for
some CPU policy not ready. Change the logic and unregister the notifer
based on the current allocated parent_cpu_data list to correctly handle
errors and the governor unregister path.

Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor")
Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/governor_passive.c