PM / OPP: Add dev_pm_opp_check_initial_rate()
authorFinley Xiao <finley.xiao@rock-chips.com>
Tue, 22 Nov 2016 09:43:43 +0000 (17:43 +0800)
committerFinley Xiao <finley.xiao@rock-chips.com>
Tue, 29 Nov 2016 06:13:37 +0000 (14:13 +0800)
commit8ad93d71d31a48098348ee1e5f3c4df4a8c63ade
tree0e78cf8d9c5fe265328b77fa38ee3ce4adbf32a8
parent7d48c319268c2a09e32c7cccd59efc18bcce359c
PM / OPP: Add dev_pm_opp_check_initial_rate()

Bootloader or kernel sets CPU frequency to an initial value before cpufreq
starts on rockchip platform, if cpu's opp table is modified to a specified
value, it will cause an issue.

For example, the initial frequency is 816MHz and voltage set by hardware
is 900mV:
1. there is only one opp whose frequency is 816MHz and voltage is 850mV
in opp table list, as they frequency is equal, the voltage will not be
changed, it is still 900mV and a little too large relative to 850mV.
2. there is only one opp whose frequency is 1200MHz and voltage is 1100mV
in opp table list, as it doesn't set voltage to 1100mV before set frequency
to 1200MHz in the dev_pm_opp_set_rate function, the initial voltage 900mV
cann't supply for 1200MHz, the system crash.

Change-Id: Id8c5efc34d9c94ff37921b33f5a76e059240d368
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
drivers/base/power/opp/core.c
include/linux/pm_opp.h