Skip to content

CPUFreq: Move freq change notifications out of drivers

Viresh Kumar cpufreq linux-arm-kernel linux-pm lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest34 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34cpufreq: move freq change notifications to cpufreq coredrivers/cpufreq/cpufreq.c include/linux/cpufreq.h+40 -00 replies
2/34cpufreq: acpi: remove calls to cpufreq_notify_transition()drivers/cpufreq/acpi-cpufreq.c+2 -122 replies
3/34cpufreq: arm_big_little: remove calls to cpufreq_notify_transition()drivers/cpufreq/arm_big_little.c+3 -220 replies
4/34cpufreq: at32ap: remove calls to cpufreq_notify_transition()drivers/cpufreq/at32ap-cpufreq.c+9 -131 reply
5/34cpufreq: blackfin: remove calls to cpufreq_notify_transition()drivers/cpufreq/blackfin-cpufreq.c+7 -150 replies
6/34cpufreq: cpu0: remove calls to cpufreq_notify_transition()drivers/cpufreq/cpufreq-cpu0.c+12 -210 replies
7/34cpufreq: cris: remove calls to cpufreq_notify_transition()drivers/cpufreq/cris-artpec3-cpufreq.c drivers/cpufreq/cris-etraxfs-cpufreq.c+0 -162 replies
8/34cpufreq: davinci: remove calls to cpufreq_notify_transition()drivers/cpufreq/davinci-cpufreq.c+10 -200 replies
9/34cpufreq: dbx500: remove calls to cpufreq_notify_transition()drivers/cpufreq/dbx500-cpufreq.c+1 -210 replies
10/34cpufreq: e_powersaver: remove calls to cpufreq_notify_transition()drivers/cpufreq/e_powersaver.c+3 -200 replies
11/34cpufreq: elanfreq: remove calls to cpufreq_notify_transition()drivers/cpufreq/elanfreq.c+0 -130 replies
12/34cpufreq: exynos: remove calls to cpufreq_notify_transition()drivers/cpufreq/exynos-cpufreq.c+8 -200 replies
13/34cpufreq: exynos5440: set CPUFREQ_NO_NOTIFICATION flagdrivers/cpufreq/exynos5440-cpufreq.c+1 -14 replies
14/34cpufreq: ia64-acpi: remove calls to cpufreq_notify_transition()drivers/cpufreq/ia64-acpi-cpufreq.c+0 -190 replies
15/34cpufreq: imx6q: remove calls to cpufreq_notify_transition()drivers/cpufreq/imx6q-cpufreq.c+16 -230 replies
16/34cpufreq: kirkwood: remove calls to cpufreq_notify_transition()drivers/cpufreq/kirkwood-cpufreq.c+20 -340 replies
17/34cpufreq: longhaul: set CPUFREQ_NO_NOTIFICATION flagdrivers/cpufreq/longhaul.c+1 -00 replies
18/34cpufreq: loongson2: remove calls to cpufreq_notify_transition()drivers/cpufreq/loongson2_cpufreq.c+0 -160 replies
19/34cpufreq: maple: remove calls to cpufreq_notify_transition()drivers/cpufreq/maple-cpufreq.c+1 -170 replies
20/34cpufreq: omap: remove calls to cpufreq_notify_transition()drivers/cpufreq/omap-cpufreq.c+14 -250 replies
21/34cpufreq: p4-clockmod: remove calls to cpufreq_notify_transition()drivers/cpufreq/p4-clockmod.c+0 -100 replies
22/34cpufreq: pasemi: remove calls to cpufreq_notify_transition()drivers/cpufreq/pasemi-cpufreq.c+1 -130 replies
23/34cpufreq: pmac: remove calls to cpufreq_notify_transition()drivers/cpufreq/pmac32-cpufreq.c drivers/cpufreq/pmac64-cpufreq.c+5 -330 replies
24/34cpufreq: powernow: remove calls to cpufreq_notify_transition()drivers/cpufreq/powernow-k6.c drivers/cpufreq/powernow-k7.c drivers/cpufreq/powernow-k8.c+2 -320 replies
25/34cpufreq: ppc: remove calls to cpufreq_notify_transition()drivers/cpufreq/ppc-corenet-cpufreq.c drivers/cpufreq/ppc_cbe_cpufreq.c+2 -360 replies
26/34cpufreq: pxa: remove calls to cpufreq_notify_transition()drivers/cpufreq/pxa2xx-cpufreq.c drivers/cpufreq/pxa3xx-cpufreq.c+6 -330 replies
27/34cpufreq: s3c: remove calls to cpufreq_notify_transition()drivers/cpufreq/s3c2416-cpufreq.c drivers/cpufreq/s3c64xx-cpufreq.c+20 -490 replies
28/34cpufreq: s5pv210: remove calls to cpufreq_notify_transition()drivers/cpufreq/s5pv210-cpufreq.c+6 -100 replies
29/34cpufreq: sa11x0: remove calls to cpufreq_notify_transition()drivers/cpufreq/sa1100-cpufreq.c drivers/cpufreq/sa1110-cpufreq.c+8 -210 replies
30/34cpufreq: sc520: remove calls to cpufreq_notify_transition()drivers/cpufreq/sc520_freq.c+0 -110 replies
31/34cpufreq: sparc: remove calls to cpufreq_notify_transition()drivers/cpufreq/sparc-us2e-cpufreq.c drivers/cpufreq/sparc-us3-cpufreq.c+0 -140 replies
32/34cpufreq: SPEAr: remove calls to cpufreq_notify_transition()drivers/cpufreq/spear-cpufreq.c+1 -120 replies
33/34cpufreq: speedstep: remove calls to cpufreq_notify_transition()drivers/cpufreq/speedstep-centrino.c drivers/cpufreq/speedstep-ich.c drivers/cpufreq/speedstep-smi.c+1 -350 replies
34/34cpufreq: tegra: remove calls to cpufreq_notify_transition()drivers/cpufreq/tegra-cpufreq.c+5 -200 replies

Reviews trailers per patch

4 of 34 patches have a Reviewed-by or Acked-by.

PatchHans-Christian EgtvedtLan TianyuAmit Daniel KachhapKukjin KimJesper Nilsson
1/34
2/34R-b
3/34
4/34A-b
5/34
6/34
7/34A-b
8/34
9/34
10/34
11/34
12/34
13/34A-b A-b
14/34
15/34
16/34
17/34
18/34
19/34
20/34
21/34
22/34
23/34
24/34
25/34
26/34
27/34
28/34
29/34
30/34
31/34
32/34
33/34
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 00/34] CPUFreq: Move freq change notifications out of drivers

Another 452 lines gone :)

Total stats upto now for all the 5 patchsets:
Viresh Kumar (186):
...

69 files changed, 700 insertions(+), 2451 deletions(-)

Net: 1751 lines gone..

-----x-------------x----------------

Most of the drivers do following in their ->target_index() routines:

	struct cpufreq_freqs freqs;
	freqs.old = old freq...
	freqs.new = new freq...

	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);

	/* Change rate here */

	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);

This is replicated over all cpufreq drivers today and there doesn't exists a good enough reason why this shouldn't be moved to cpufreq core instead.

There are few special cases though, like exynos5440, which doesn't do everything on the call to ->target_index() routine and call some kind of bottom halves for doing this work, work/tasklet/etc..

They may continue doing notification from their own code and so this patch introduces another flag: CPUFREQ_NO_NOTIFICATION, which will be set by such drivers.

This is Fifth part of my cleanup work for CPUFreq, first three are (And obviously its rebased over them):

1: cpufreq: Introduce cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263

2: cpufreq: define generic routines for cpufreq drivers
https://lkml.org/lkml/2013/8/10/48

3. CPUFreq: Implement light weight ->target(): for 3.13
https://lkml.org/lkml/2013/8/13/349

4. CPUFreq: set policy->cur in cpufreq core instead of drivers
https://lkml.org/lkml/2013/8/14/288

All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-v3.13

--
viresh

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc Eric Miao <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc John Crispin <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mikael Starvik <[email protected]>
Cc Russell King <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Steven Miao <[email protected]>
Cc Tony Luck <[email protected]>

Viresh Kumar (34):
cpufreq: move freq change notifications to cpufreq core
cpufreq: acpi: remove calls to cpufreq_notify_transition()
cpufreq: arm_big_little: remove calls to cpufreq_notify_transition()
cpufreq: at32ap: remove calls to cpufreq_notify_transition()
cpufreq: blackfin: remove calls to cpufreq_notify_transition()
cpufreq: cpu0: remove calls to cpufreq_notify_transition()
cpufreq: cris: remove calls to cpufreq_notify_transition()
cpufreq: davinci: remove calls to cpufreq_notify_transition()
cpufreq: dbx500: remove calls to cpufreq_notify_transition()
cpufreq: e_powersaver: remove calls to cpufreq_notify_transition()
cpufreq: elanfreq: remove calls to cpufreq_notify_transition()
cpufreq: exynos: remove calls to cpufreq_notify_transition()
cpufreq: exynos5440: set CPUFREQ_NO_NOTIFICATION flag
cpufreq: ia64-acpi: remove calls to cpufreq_notify_transition()
cpufreq: imx6q: remove calls to cpufreq_notify_transition()
cpufreq: kirkwood: remove calls to cpufreq_notify_transition()
cpufreq: longhaul: set CPUFREQ_NO_NOTIFICATION flag
cpufreq: loongson2: remove calls to cpufreq_notify_transition()
cpufreq: maple: remove calls to cpufreq_notify_transition()
cpufreq: omap: remove calls to cpufreq_notify_transition()
cpufreq: p4-clockmod: remove calls to cpufreq_notify_transition()
cpufreq: pasemi: remove calls to cpufreq_notify_transition()
cpufreq: pmac: remove calls to cpufreq_notify_transition()
cpufreq: powernow: remove calls to cpufreq_notify_transition()
cpufreq: ppc: remove calls to cpufreq_notify_transition()
cpufreq: pxa: remove calls to cpufreq_notify_transition()
cpufreq: s3c: remove calls to cpufreq_notify_transition()
cpufreq: s5pv210: remove calls to cpufreq_notify_transition()
cpufreq: sa11x0: remove calls to cpufreq_notify_transition()
cpufreq: sc520: remove calls to cpufreq_notify_transition()
cpufreq: sparc: remove calls to cpufreq_notify_transition()
cpufreq: SPEAr: remove calls to cpufreq_notify_transition()
cpufreq: speedstep: remove calls to cpufreq_notify_transition()
cpufreq: tegra: remove calls to cpufreq_notify_transition()

 drivers/cpufreq/acpi-cpufreq.c         | 14 ++-------
 drivers/cpufreq/arm_big_little.c       | 25 ++--------------
 drivers/cpufreq/at32ap-cpufreq.c       | 22 ++++++--------
 drivers/cpufreq/blackfin-cpufreq.c     | 22 +++++---------
 drivers/cpufreq/cpufreq-cpu0.c         | 33 ++++++++-------------
 drivers/cpufreq/cpufreq.c              | 34 +++++++++++++++++++++
 drivers/cpufreq/cris-artpec3-cpufreq.c |  8 -----
 drivers/cpufreq/cris-etraxfs-cpufreq.c |  8 -----
 drivers/cpufreq/davinci-cpufreq.c      | 30 +++++++------------
 drivers/cpufreq/dbx500-cpufreq.c       | 22 +-------------
 drivers/cpufreq/e_powersaver.c         | 23 ++-------------
 drivers/cpufreq/elanfreq.c             | 13 --------
 drivers/cpufreq/exynos-cpufreq.c       | 28 +++++-------------
 drivers/cpufreq/exynos5440-cpufreq.c   |  2 +-
 drivers/cpufreq/ia64-acpi-cpufreq.c    | 19 ------------
 drivers/cpufreq/imx6q-cpufreq.c        | 39 ++++++++++--------------
 drivers/cpufreq/kirkwood-cpufreq.c     | 54 +++++++++++++---------------------
 drivers/cpufreq/longhaul.c             |  1 +
 drivers/cpufreq/loongson2_cpufreq.c    | 16 ----------
 drivers/cpufreq/maple-cpufreq.c        | 18 +-----------
 drivers/cpufreq/omap-cpufreq.c         | 39 +++++++++---------------
 drivers/cpufreq/p4-clockmod.c          | 10 -------
 drivers/cpufreq/pasemi-cpufreq.c       | 14 +--------
 drivers/cpufreq/pmac32-cpufreq.c       | 20 +++----------
 drivers/cpufreq/pmac64-cpufreq.c       | 18 +-----------
 drivers/cpufreq/powernow-k6.c          |  8 -----
 drivers/cpufreq/powernow-k7.c          | 11 +------
 drivers/cpufreq/powernow-k8.c          | 15 +---------
 drivers/cpufreq/ppc-corenet-cpufreq.c  | 19 +-----------
 drivers/cpufreq/ppc_cbe_cpufreq.c      | 19 +-----------
 drivers/cpufreq/pxa2xx-cpufreq.c       | 27 ++++-------------
 drivers/cpufreq/pxa3xx-cpufreq.c       | 12 --------
 drivers/cpufreq/s3c2416-cpufreq.c      | 21 +++----------
 drivers/cpufreq/s3c64xx-cpufreq.c      | 48 ++++++++++--------------------
 drivers/cpufreq/s5pv210-cpufreq.c      | 16 ++++------
 drivers/cpufreq/sa1100-cpufreq.c       | 17 ++++-------
 drivers/cpufreq/sa1110-cpufreq.c       | 12 ++------
 drivers/cpufreq/sc520_freq.c           | 11 -------
 drivers/cpufreq/sparc-us2e-cpufreq.c   |  7 -----
 drivers/cpufreq/sparc-us3-cpufreq.c    |  7 -----
 drivers/cpufreq/spear-cpufreq.c        | 13 +-------
 drivers/cpufreq/speedstep-centrino.c   | 20 +------------
 drivers/cpufreq/speedstep-ich.c        |  9 ------
 drivers/cpufreq/speedstep-smi.c        |  7 -----
 drivers/cpufreq/tegra-cpufreq.c        | 25 ++++------------
 include/linux/cpufreq.h                |  6 ++++
 46 files changed, 205 insertions(+), 657 deletions(-)
Signature · 1 line
1.7.12.rc2.18.g61b472e