linux/drivers/cpufreq
Viresh Kumar 1c03a2d04d cpufreq: add support for intermediate (stable) frequencies
Douglas Anderson, recently pointed out an interesting problem due to which
udelay() was expiring earlier than it should.

While transitioning between frequencies few platforms may temporarily switch to
a stable frequency, waiting for the main PLL to stabilize.

For example: When we transition between very low frequencies on exynos, like
between 200MHz and 300MHz, we may temporarily switch to a PLL running at 800MHz.
No CPUFREQ notification is sent for that. That means there's a period of time
when we're running at 800MHz but loops_per_jiffy is calibrated at between 200MHz
and 300MHz. And so udelay behaves badly.

To get this fixed in a generic way, introduce another set of callbacks
get_intermediate() and target_intermediate(), only for drivers with
target_index() and CPUFREQ_ASYNC_NOTIFICATION unset.

get_intermediate() should return a stable intermediate frequency platform wants
to switch to, and target_intermediate() should set CPU to that frequency,
before jumping to the frequency corresponding to 'index'. Core will take care of
sending notifications and driver doesn't have to handle them in
target_intermediate() or target_index().

NOTE: ->target_index() should restore to policy->restore_freq in case of
failures as core would send notifications for that.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-06-05 23:32:29 +02:00
..
Kconfig cpufreq: enable ARM drivers on arm64 2014-03-01 00:55:40 +01:00
Kconfig.arm cpufreq: Enable big.LITTLE cpufreq driver on arm64 2014-05-17 01:22:14 +02:00
Kconfig.powerpc cpufreq: powernv: cpufreq driver for powernv platform 2014-04-07 14:35:27 +02:00
Kconfig.x86 cpufreq: Kconfig: Fix spelling errors 2014-05-01 01:18:19 +02:00
Makefile PM / OPP: Move cpufreq specific OPP functions out of generic OPP library 2014-05-07 00:39:03 +02:00
acpi-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
amd_freq_sensitivity.c
arm_big_little.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
arm_big_little.h
arm_big_little_dt.c
at32ap-cpufreq.c cpufreq: at32ap: don't declare local variable as static 2014-04-07 14:31:33 +02:00
blackfin-cpufreq.c cpufreq: Remove cpufreq_generic_exit() 2014-03-12 01:06:00 +01:00
cpufreq-cpu0.c cpufreq: cpu0: drop wrong devm usage 2014-05-20 01:29:20 +02:00
cpufreq-nforce2.c cpufreq: nforce2: remove DEFINE_PCI_DEVICE_TABLE macro 2014-05-17 01:16:15 +02:00
cpufreq.c cpufreq: add support for intermediate (stable) frequencies 2014-06-05 23:32:29 +02:00
cpufreq_conservative.c
cpufreq_governor.c cpufreq: remove race while accessing cur_policy 2014-05-20 01:25:15 +02:00
cpufreq_governor.h
cpufreq_ondemand.c
cpufreq_opp.c PM / OPP: Move cpufreq specific OPP functions out of generic OPP library 2014-05-07 00:39:03 +02:00
cpufreq_performance.c
cpufreq_powersave.c
cpufreq_stats.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
cpufreq_userspace.c
cris-artpec3-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
cris-etraxfs-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
davinci-cpufreq.c cpufreq: Remove cpufreq_generic_exit() 2014-03-12 01:06:00 +01:00
dbx500-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
e_powersaver.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
elanfreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
exynos-cpufreq.c cpufreq: exynos: Use dev_err/info function instead of pr_err/info 2014-05-01 01:00:39 +02:00
exynos-cpufreq.h cpufreq: exynos: Use dev_err/info function instead of pr_err/info 2014-05-01 01:00:39 +02:00
exynos4x12-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
exynos4210-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
exynos5250-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
exynos5440-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
freq_table.c cpufreq: Break out early when frequency equals target_freq 2014-05-20 14:02:09 +02:00
gx-suspmod.c cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} 2014-03-26 16:41:41 +01:00
highbank-cpufreq.c
ia64-acpi-cpufreq.c cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table 2014-04-07 14:43:49 +02:00
imx6q-cpufreq.c cpufreq: imx6q: Remove unused include 2014-05-17 01:34:42 +02:00
integrator-cpufreq.c cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} 2014-03-26 16:41:41 +01:00
intel_pstate.c Merge back earlier cpufreq material. 2014-06-03 15:03:27 +02:00
kirkwood-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
longhaul.c Merge branch 'cpufreq-macros' into pm-cpufreq 2014-05-01 00:50:47 +02:00
longhaul.h
longrun.c
loongson2_cpufreq.c MIPS/loongson2_cpufreq: Fix CPU clock rate setting 2014-05-13 00:29:41 +02:00
maple-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
omap-cpufreq.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
p4-clockmod.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
pasemi-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
pcc-cpufreq.c cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} 2014-03-26 16:41:41 +01:00
pmac32-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
pmac64-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
powernow-k6.c Merge branch 'cpufreq-macros' into pm-cpufreq 2014-05-01 00:50:47 +02:00
powernow-k7.c cpufreq: powernow-k7: Fix double invocation of cpufreq_freq_transition_begin/end 2014-04-29 01:22:54 +02:00
powernow-k7.h
powernow-k8.c cpufreq: powernow-k8: Suppress checkpatch warnings 2014-05-17 01:27:01 +02:00
powernow-k8.h cpufreq: powernow-k8: Suppress checkpatch warnings 2014-05-17 01:27:01 +02:00
powernv-cpufreq.c cpufreq: powernv: make local function static 2014-05-17 01:25:46 +02:00
ppc-corenet-cpufreq.c cpufreq: ppc-corenet-cpufreq: Fix __udivdi3 modpost error 2014-04-29 01:28:17 +02:00
ppc_cbe_cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
ppc_cbe_cpufreq.h
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c
pxa2xx-cpufreq.c cpufreq: Remove cpufreq_generic_exit() 2014-03-12 01:06:00 +01:00
pxa3xx-cpufreq.c cpufreq: Remove cpufreq_generic_exit() 2014-03-12 01:06:00 +01:00
s3c24xx-cpufreq-debugfs.c
s3c24xx-cpufreq.c cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table 2014-04-07 14:43:49 +02:00
s3c64xx-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
s3c2410-cpufreq.c
s3c2412-cpufreq.c
s3c2416-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
s3c2440-cpufreq.c
s5pv210-cpufreq.c cpufreq: s5pv210: drop check for CONFIG_PM_VERBOSE 2014-05-27 01:06:44 +02:00
sa1100-cpufreq.c
sa1110-cpufreq.c
sc520_freq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
sh-cpufreq.c cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} 2014-03-26 16:41:41 +01:00
sparc-us2e-cpufreq.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
sparc-us3-cpufreq.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
spear-cpufreq.c cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table 2014-04-07 14:43:49 +02:00
speedstep-centrino.c cpufreq: Make linux-pm@vger.kernel.org official mailing list 2014-05-01 01:15:32 +02:00
speedstep-ich.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
speedstep-lib.c
speedstep-lib.h
speedstep-smi.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
tegra-cpufreq.c cpufreq: Tegra: drop wrapper around tegra_update_cpu_speed() 2014-05-17 01:38:31 +02:00
unicore2-cpufreq.c cpufreq: unicore32: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO 2014-04-21 23:42:27 +02:00
vexpress-spc-cpufreq.c