Cpufreq cleanups with a view to more consolidation and simpler drivers

Registered by Amit Kucheria

Cleanup cpufreq and gain more experience with it. This might require changes to some of the core parts of cpufreq framework with some user drivers too..

Blueprint information

Status:
Complete
Approver:
Amit Kucheria
Priority:
Medium
Drafter:
Amit Kucheria
Direction:
Approved
Assignee:
viresh kumar
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon 2013.05
Started by
Amit Kucheria
Completed by
Serge Broslavsky

Related branches

Sprints

Whiteboard

Meta:
Roadmap id: CARD-192
Headline: TBD
Acceptance: TBD

[vireshk: 2013-02-01] I have been working on this activity since sometime. I am reviewing all the stuff over mainline around cpufreq. And attempting to fix most of the parts which have issues.

Until now i have been part of these patches (either was author or a strong reviewer):

530dbda cpufreq: Remove unnecessary use of policy->shared_type
f8123c3 cpufreq: Set all cpus in policy->cpus for single cluster SoCs
888b247 cpufreq: TEGRA: Set policy->cpus from driver->init()
d9de945 cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()
5ea3e5b cpufreq: governors: Remove code redundancy between governors
09a94ff cpufreq: governors: Get rid of dbs_data->enable field
faa8107 cpufreq: governors: implement generic policy_is_shared
88fe0a9 cpufreq: governors: clean timer init and exit code
13c18e8 cpufreq: governors: fix misuse of cdbs.cpu
5328316 cpufreq: exynos: simplify .init() for setting policy->cpus
7fb23d7 cpufreq: Update Documentation for cpus and related_cpus
4948b35 cpufreq: Simplify cpufreq_add_dev()
c3e1fc1 cpufreq: Revert "cpufreq: Don't use cpu removed during cpufreq_driver_unregister"
6b2b17e cpufreq: Sort function prototypes properly
b5669aa cpufreq: Simplify __cpufreq_remove_dev()

[vireshk: 2013-Feb-04] Create per policy instances of ondemand and conservative governors, so that we have separate governor tunables for each cluster. V1 sent for review:

b16436f cpufreq: governor: Implement per policy instances of governors
c106ad5 cpufreq: Add per policy governor-init/exit infrastructure
0f3f222 cpufreq: stats: Get rid of CPUFREQ_STATDEVICE_ATTR
ffce012 cpufreq: Don't check cpu_online(policy->cpu)

[vireshk: 2013-Feb-07] Fixed more bugs

0e12dcf ARM: SPEAr13xx: Enable CONFIG_ARCH_HAS_CPUFREQ
50f6802 cpufreq: Fix locking issues
7b681ff cpufreq: Create a macro for unlock_policy_rwsem{read,write}
eb7c288 cpufreq: Remove unused HOTPLUG_CPU code
007dda3 cpufreq: governors: Fix WARN_ON() for multi-policy platforms

Reviewed:
55febc4 cpufreq/x86: Add P-state driver for sandy bridge.
cb7389f cpufreq_stats: do not remove sysfs files if frequency table is not present
3bc8555 cpufreq: Do not track governor name for scaling drivers with internal governors.
90a8f4a cpufreq: Only call cpufreq_out_of_sync() for driver that implement cpufreq_driver.target()
7eb5c85 cpufreq: Retrieve current frequency from scaling drivers with internal governors

[vireshk: 2013-March-01] Fixed more issues:
0841423 cpufreq: governor: Set MIN_LATENCY_MULTIPLIER to 20
90f6cf0 cpufreq: ondemand: Don't update sample_type if we don't evaluate load again
257d576 cpufreq: governors: Avoid unnecessary per cpu timer interrupts

[vireshk: 2013-March-20]
Reviewing every patch over cpufreq mailing list now a days.
Reviewing/fixing (guiding people over) Bugs over cpufreq mailing list
Fixing issues reported by Rafael over per policy governor instance patchset

[vireshk: 2013-March-26]
Many patches this time:

Fixed and pushed to mainline:
aa77a52 cpufreq: acpi-cpufreq: Don't set policy->related_cpus from .init()
187da1d cpufreq: stats: do cpufreq_cpu_put() corresponding to cpufreq_cpu_get()

Getting reviewed:
ba168a3 powerpc: cpufreq: move cpufreq driver to drivers/cpufreq
4b19c7a sparc: cpufreq: move cpufreq driver to drivers/cpufreq
8bb0825 unicore2: cpufreq: move cpufreq driver to drivers/cpufreq
8b9b53c sh: cpufreq: move cpufreq driver to drivers/cpufreq
e5013e5 mips: cpufreq: move cpufreq driver to drivers/cpufreq
1d86318 ia64: cpufreq: move cpufreq driver to drivers/cpufreq
77b7982 cris: cpufreq: move cpufreq driver to drivers/cpufreq
0e00e8d blackfin: cpufreq: move cpufreq driver to drivers/cpufreq
0ed1f06 AVR32: cpufreq: move cpufreq driver to drivers/cpufreq
d237feb cpufreq: sa11x0: move cpufreq driver to drivers/cpufreq
d285a30 cpufreq: s3c24xx: move cpufreq driver to drivers/cpufreq
a6dbe12 cpufreq: pxa2xx: move cpufreq driver to drivers/cpufreq
8f87a54 cpufreq: pxa3xx: move cpufreq driver to drivers/cpufreq
c6b170b cpufreq: integrator: move cpufreq driver to drivers/cpufreq
9baf7aa cpufreq: imx: move cpufreq driver to drivers/cpufreq
3216664 cpufreq: davinci: move cpufreq driver to drivers/cpufreq
2df1f14 cpufreq: tegra: Move driver to drivers/cpufreq
c9a7f12 cpufreq: ARM: Arrange drivers in alphabetical order
d9f529e cpufreq: drivers: Remove unnecessary assignments of policy-> members
3a34f16 cpufreq: drivers: don't check range of target freq in .target()
ae9f33e cpufreq: Don't check if cpu is online/offline for cpufreq callbacks
29f008c cpufreq: Notify all policy->cpus in cpufreq_notify_transition()

big LITTLE cpufreq driver V2: Getting reviewed
1f864ec cpufreq: ARM big LITTLE: Add generic cpufreq driver and its DT glue

[vireshk: 2013-April-01]
New patches:

eeddb86 cpufreq: Raname index as data in cpufreq_frequency_table
3ea56c3 tools: cpufreq: Fix cpufreq-info print messages for affected[related]_cpus
905a002 cpufreq: cpufreq-cpu0: Call CPUFREQ_POSTCHANGE notifier for failure cases too
e15015f cpufreq: cpufreq-cpu0: No need to check cpu number in init()
314fe58 cpufreq: Documentation: Fix cpufreq_frequency_table name
b2577e6 cpufreq: cpu0: Fix mistake in Documentation example

Some stats on what we did in 3.9:
--------------------------------------------
Number of patches where i was author:
$ git log --oneline v3.8..v3.9-rc5 --author=viresh | wc -l
26 (cpufreq patches only)

And number of cpufreq patches that i Acked:
$ git log --oneline v3.8..v3.9-rc5 --grep=viresh -- drivers/cpufreq/ | wc -l (# minus where i was author)
22

[vireshk: 2013-May-13]
Patches that went into 3.10-rc1/rc2: 45

7bd353a cpufreq: Add per policy governor-init/exit infrastructure
4d5dcc4 cpufreq: governor: Implement per policy instances of governors
98104ee cpufreq: governor: Set MIN_LATENCY_MULTIPLIER to 20
9d44592 cpufreq: ondemand: Don't update sample_type if we don't evaluate load again
031299b cpufreq: governors: Avoid unnecessary per cpu timer interrupts
b2a6343 cpufreq: cpu0: Fix mistake in Documentation example
3a7818e cpufreq: Documentation: Fix cpufreq_frequency_table name
746b3df cpufreq: cpufreq-cpu0: No need to check cpu number in init()
fd143b4 cpufreq: cpufreq-cpu0: Call CPUFREQ_POSTCHANGE notifier for failure cases too
b43a7ff cpufreq: Notify all policy->cpus in cpufreq_notify_transition()
e9f5183 cpufreq: Don't check if cpu is online/offline for cpufreq callbacks
8a00627 cpufreq: drivers: don't check range of target freq in .target()
eb2f50f cpufreq: drivers: Remove unnecessary assignments of policy-> members
8a67f0e cpufreq: ARM big LITTLE: Add generic cpufreq driver and its DT glue
a0ea048 cpufreq: ARM: Arrange drivers in alphabetical order
ceff98e cpufreq: tegra: Move driver to drivers/cpufreq
8a7b122 cpufreq: davinci: move cpufreq driver to drivers/cpufreq
adde904 cpufreq: pxa3xx: move cpufreq driver to drivers/cpufreq
cffc96e cpufreq: pxa2xx: move cpufreq driver to drivers/cpufreq
b7e614c cpufreq: integrator: move cpufreq driver to drivers/cpufreq
59a2e61 cpufreq: sa11x0: move cpufreq driver to drivers/cpufreq
81c720c cpufreq: AVR32: move cpufreq driver to drivers/cpufreq
d5cc990 cpufreq: blackfin: move cpufreq driver to drivers/cpufreq
8e8aa95 cpufreq: cris: move cpufreq driver to drivers/cpufreq
ab423e4 cpufreq: ia64: move cpufreq driver to drivers/cpufreq
7a99893 cpufreq: mips: move cpufreq driver to drivers/cpufreq
7258267 cpufreq: sh: move cpufreq driver to drivers/cpufreq
73cc9c8 cpufreq: unicore2: move cpufreq driver to drivers/cpufreq
764295a cpufreq: sparc: move cpufreq driver to drivers/cpufreq
6eb1c37 cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq
e4969eb cpufreq: Call __cpufreq_governor() with correct policy->cpus mask
820c6ca cpufreq: Don't call __cpufreq_governor() for drivers without target()
763f8c3 cpufreq: ARM big LITTLE: put DT nodes after using them
ad61f44 cpufreq: ARM big LITTLE: Adapt to latest cpufreq updates
141b467 cpufreq: cpu0: Put cpu parent node after using it
45c009a cpufreq: MAINTAINERS: Add co-maintainer
bb08be7 cpufreq: ARM big LITTLE: Select PM_OPP
996905f cpufreq: ARM big LITTLE DT: Return correct transition latency
3c792e0 cpufreq: ARM big LITTLE DT: Return CPUFREQ_ETERNAL if clock-latency isn't found
4521adf cpufreq: ARM big LITTLE: Move cpu_to_cluster() to arm_big_little.h
2b80f31 cpufreq: ARM big LITTLE: Improve print message
a97c98a cpufreq: governors: Fix CPUFREQ_GOV_POLICY_{INIT|EXIT} notifiers
d96038e cpufreq: Issue CPUFREQ_GOV_POLICY_EXIT notifier before dropping policy refcount
5aaa9cc cpufreq: cpufreq-cpu0: Free parent node for error cases
99af771 cpufreq: ARM big LITTLE: Fix Kconfig entries

[vireshk: 2013-June-27]
More patches

f56cc99 cpufreq: tegra: call CPUFREQ_POSTCHANGE notfier in error cases
6cdc9ef cpufreq: s3c64xx: call CPUFREQ_POSTCHANGE notfier in error cases
44a49a2 cpufreq: omap: call CPUFREQ_POSTCHANGE notfier in error cases
5a571c3 cpufreq: imx6q: call CPUFREQ_POSTCHANGE notfier in error cases
c3aca6b cpufreq: exynos: call CPUFREQ_POSTCHANGE notfier in error cases
803c126 cpufreq: dbx500: call CPUFREQ_POSTCHANGE notfier in error cases
f20b97d cpufreq: davinci: call CPUFREQ_POSTCHANGE notfier in error cases
3d69dd5 cpufreq: arm-big-little: call CPUFREQ_POSTCHANGE notfier in error cases
7f77a56 cpufreq: powernow-k8: call CPUFREQ_POSTCHANGE notfier in error cases
f77f146 cpufreq: pcc: call CPUFREQ_POSTCHANGE notfier in error cases
567f4f6 cpufreq: e_powersaver: call CPUFREQ_POSTCHANGE notfier in error cases
e15d830 cpufreq: ACPI: call CPUFREQ_POSTCHANGE notfier in error cases
0956df9c cpufreq: make __cpufreq_notify_transition() static
bb176f7 cpufreq: Fix minor formatting issues
d1922f0 cpufreq: Simplify userspace governor
dbcc9f8 cpufreq: X86_AMD_FREQ_SENSITIVITY: select CPU_FREQ_TABLE
dbb8d76 cpufreq: tegra: create CONFIG_ARM_TEGRA_CPUFREQ
6866cba cpufreq: S3C2416/S3C64XX: select CPU_FREQ_TABLE
5f5e302 cpufreq: powerpc: CBE_RAS: select CPU_FREQ_TABLE
5d6a62b cpufreq: imx: select CPU_FREQ_TABLE
29c4b57 cpufreq: highbank: remove select CPU_FREQ_TABLE
46f3049 cpufreq: exynos: select CPU_FREQ_TABLE
96070b1 cpufreq: blackfin: enable driver for CONFIG_BFIN_CPU_FREQ
7fb6a53 cpufreq: powerpc: move cpufreq driver to drivers/cpufreq
a262e94 cpufreq: remove unnecessary cpufreq_cpu_{get|put}() calls
5070158 cpufreq: rename index as driver_data in cpufreq_frequency_table
2361be2 cpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directory
72a4ce3 cpufreq: Move get_cpu_idle_time() to cpufreq.c
944e9a0 cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
3f869d6 cpufreq: Add EXPORT_SYMBOL_GPL for have_governor_per_policy
5d69030 cpufreq: tegra: Don't initialize .index field of cpufreq_frequency_table
9076eac cpufreq: arm_big_little_dt: Instantiate as platform_driver
92a9b5c cpufreq: arm_big_little_dt: Register driver only if DT has valid data
955ef48 cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT

More to go.

(?)

Work Items

Work items for 2013.01:
Fix cpufreq_add_dev() and cpufreq_remove_dev() to make them simple: DONE
Fix remaining issues with hot-[un]plugging of cpus: DONE
Update Documentation with latest changes: DONE

Work items for 2013.02:
Fix all cpufreq platform driver over usage of policy->cpus, policy->related_cpus and policy->shared_type: DONE
Get Ondemand & conservative governors fixed, which were changed recently by <email address hidden>: DONE
Create per policy instances of ondemand and conservative governors, so that we have separate governor tunables for each cluster: DONE

Work items for 2013.03:
Get earlier patches upstream with all bugs resolved due to them: DONE
Get all bugs resolved in 3.9-rcs, due to the big number of patches that got in from Linaro: DONE
Move all cpufreq drivers from arch/ to drivers/cpufreq: DONE
Fix/cleanup generic cpufreq drivers and core for better/clear code: DONE

Work items for 2013.04:
Get pending patches upstreamed (Review is mostly done): DONE
Review patches over cpufreq mailing list: DONE
Review/fix (guide people) Bugs over cpufreq mailing list: DONE

Work items for 2013.06:
Review patches over cpufreq mailing list: DONE
Review/fix (guide people) Bugs over cpufreq mailing list: DONE
Send more cpufreq cleanups upstream: DONE

Work items for 2013.07:
Review patches over cpufreq mailing list: DONE
Review/fix (guide people) Bugs over cpufreq mailing list: DONE

This blueprint contains Public information 
Everyone can see this information.