All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] clockevents for 4.5
@ 2015-12-17 14:50 ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-17 14:50 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linux Kernel Mailing List, linux-arm-kernel, Ingo Molnar

Hi Thomas,

this pull request is bigger than the other ones. It contains a lot of 
changes and cleanups in order to increase the compilation test coverage.

  - Add cosmetic changes on error and a memory leakage on failure at 
init time for the mediatek timer (Alexey Klimov)

  - Remove the useless dsb() usage in the rockchip timer, the side 
effect is it can compile for the ARM and ARM64 (Caesar Wang)

  - Huge cleanups and fixes for the timers st_lpc, pxa_timer, tango, 
pistachio, mediatek, rockchip, armada-370-xp, meson6, orion, digicolor, 
dw_apb, sun4i, sun5i, tegra2, vt8500, cadence_ttc, asm9260, lpc32xx, 
nomadik_mtu, prcmu, exynos_mct, samsung-pwm and fsl-ftm in order to add 
the COMPILE_TEST option (Daniel Lezcano)

  - Cleanup of the h8300 timers and add the COMPILE_TEST option (Daniel 
Lezcano)

  - Factor out the tango-xtal and the timer_sun5i code by using the 
clocksource_mmio_init (Daniel Lezcano)

  - Fix suspend / resume on the arch_arm_timer (Grygorii Strashko)

  - Implement an ARM delay timer, fix return value and use relaxed io to 
improve performances on the dw_apb_timer (Jisheng Zhang)

  - Improve greatly performances by using writel_relaxed in 
gt_compare_set in the arm_global_timer (Jisheng Zhang)

  - Use the dynamic irq affinity flag on the tegra2 timer (Lucas Stach)

  - Correct pr_err() output format on the lpc32 timer (Vladimir Zapolskiy)

  - Second round of cleanups on the h8300 timers (Yoshinori Sato)

Tested on kernelci.org:
https://kernelci.org/build/dlezcano/kernel/v4.4-rc2-71-gd33f250af4e6/
https://kernelci.org/boot/all/job/dlezcano/kernel/v4.4-rc2-71-gd33f250af4e6/

Thanks !

   -- Daniel


The following changes since commit 82bbe34b3d895fb026b2fc0e7da2e641797bfaed:

   nohz: Clarify magic in tick_nohz_stop_sched_tick() (2015-11-25 
22:37:27 +0100)

are available in the git repository at:

   http://git.linaro.org/people/daniel.lezcano/linux.git kevin-bot

for you to fetch changes up to d33f250af4e67d449f2c748b861ba99d50955469:

   clocksource/drivers/h8300: Use ioread / iowrite (2015-12-16 17:20:13 
+0100)

----------------------------------------------------------------
Alexey Klimov (3):
       clocksource/drivers/mtk_timer: Add pr_fmt define
       clocksource/drivers/mtk_timer: Fix pr_warn() messages in 
mtk_timer_init
       clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()

Caesar Wang (2):
       clocksource/drivers/rockchip: Make the driver more readable
       clocksource/drivers/rockchip: Remove dsb() usage

Daniel Lezcano (49):
       time: Define dummy functions for the generic sched clock
       clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM 
architecture
       clocksource/drivers/st_lpc: Fix Kconfig dependency
       clocksource/drivers/st_lpc: Add the COMPILE_TEST option
       clocksource/drivers/pxa_timer: Move the Kconfig rule
       clocksource/drivers/pxa_timer: Add the COMPILE_TEST option
       clocksource/drivers/tango: Add COMPILE_TEST option
       clocksource/drivers/pistachio: Add the COMPILE_TEST option
       clocksource/drivers/mediatek: Add the COMPILE_TEST option
       clocksource/drivers/rockchip: Add COMPILE_TEST option
       clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option
       clocksource/drivers/meson6: Add the COMPILE_TEST option
       clocksource/drivers/orion: Add the COMPILE_TEST option
       clocksource/drivers/digicolor: Add the COMPILE_TEST option
       clocksource/drivers/dw_apb: Add the COMPILE_TEST option
       clocksource/drivers/sun4i: Add the COMPILE_TEST option
       clocksource/drivers/sun5i: Add the COMPILE_TEST option
       clocksource/drivers/tegra2: Add the COMPILE_TEST option
       clocksource/drivers/vt8500: Remove unneeded header
       clocksource/drivers/vt8500: Add the COMPILE_TEST option
       clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option
       clocksource/drivers/asm9260: Add the COMPILE_TEST option
       clocksource/drivers/lpc32xx: Add the COMPILE_TEST option
       clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option
       clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option
       clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST 
option
       clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option
       clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option
       clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS 
dependency
       clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn
       clocksource/drivers/h8300_tpu: Remove unused macros
       clocksource/drivers/h8300_tpu: Remove pointless headers for TPU
       clocksource/drivers/h8300_timer8: Remove unused headers
       clocksource/drivers/h8300_timer8: Remove unused macros
       clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
       clocksource/drivers/h8300_timer8: Fix irq return value check
       clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant 
safe code
       clocksource/drivers/h8300_timer8: Remove irq and lock legacy code
       clocksource/drivers/h8300_timer8: Retrieve the clock rate at init 
time
       clocksource/drivers/h8300_timer16: Remove pointless headers
       clocksource/drivers/h8300_timer16: Remove unused macros
       clocksource/drivers/h8300_timer16: Remove unused fields in 
timer16_priv
       clocksource/drivers/h8300_timer16: Fix irq return value check
       clocksource/drivers/h8300_timer16: Remove pointless lock
       clocksource/drivers/timer_sun5i: Replace code by 
clocksource_mmio_init
       clocksource/drivers/h8300_timer8: Separate the Kconfig option 
from the arch
       h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]
       clocksource/drivers/h8300: Increase the compilation test coverage
       clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init

Grygorii Strashko (1):
       clocksource/drivers/arm_global_timer: Fix suspend resume

Jisheng Zhang (6):
       clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer
       clocksource/drivers/dw_apb_timer: Fix apbt_readl return types
       clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in 
critical path
       clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
       clockevents/drivers/arm_global_timer: Use writel_relaxed in 
gt_compare_set
       clocksource/drivers/pistachio: Fix wrong calculated clocksource 
read value

Lucas Stach (1):
       clocksource/drivers/tegra: Allow timer irq affinity change

Vladimir Zapolskiy (1):
       clocksource/drivers/lpc32: Correct pr_err() output format

Yoshinori Sato (6):
       clocksource/drivers/h8300: Cleanup startup and remove module code.
       clocksource/drivers/h8300: Change to overflow interrupt
       clocksource/drivers/h8300: Fix timer not overflow case
       clocksource/drivers/h8300: Simplify delta handling
       clocksource/drivers/h8300: Initializer cleanup.
       clocksource/drivers/h8300: Use ioread / iowrite

  arch/arm/Kconfig                       |   3 +++
  arch/arm/mach-exynos/Kconfig           |   1 +
  arch/arm/mach-sti/Kconfig              |   1 +
  arch/arm/mach-ux500/Kconfig            |   1 +
  arch/h8300/Kconfig                     |   1 +
  arch/h8300/include/asm/io.h            |  39 
++++++++++++++++++++--------------
  arch/h8300/kernel/setup.c              |   8 +++----
  drivers/clocksource/Kconfig            | 132 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
  drivers/clocksource/Makefile           |   2 +-
  drivers/clocksource/arm_global_timer.c |  21 +++++++++++++-----
  drivers/clocksource/dw_apb_timer.c     |  46 
+++++++++++++++++++++++++---------------
  drivers/clocksource/dw_apb_timer_of.c  |  16 ++++++++++++++
  drivers/clocksource/h8300_timer16.c    | 222 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------
  drivers/clocksource/h8300_timer8.c     | 264 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------
  drivers/clocksource/h8300_tpu.c        | 159 
++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------
  drivers/clocksource/mtk_timer.c        |  20 ++++++++++--------
  drivers/clocksource/rockchip_timer.c   |  23 +++++++++-----------
  drivers/clocksource/tango_xtal.c       |  18 +++-------------
  drivers/clocksource/tegra20_timer.c    |   3 ++-
  drivers/clocksource/time-lpc32xx.c     |   4 ++--
  drivers/clocksource/time-pistachio.c   |   2 +-
  drivers/clocksource/timer-sun5i.c      |  16 ++------------
  drivers/clocksource/vt8500_timer.c     |   1 -
  drivers/irqchip/irq-renesas-h8300h.c   |   8 +++----
  include/linux/sched_clock.h            |  12 ++++++++---
  25 files changed, 454 insertions(+), 569 deletions(-)

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 154+ messages in thread

* [GIT PULL] clockevents for 4.5
@ 2015-12-17 14:50 ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-17 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

this pull request is bigger than the other ones. It contains a lot of 
changes and cleanups in order to increase the compilation test coverage.

  - Add cosmetic changes on error and a memory leakage on failure at 
init time for the mediatek timer (Alexey Klimov)

  - Remove the useless dsb() usage in the rockchip timer, the side 
effect is it can compile for the ARM and ARM64 (Caesar Wang)

  - Huge cleanups and fixes for the timers st_lpc, pxa_timer, tango, 
pistachio, mediatek, rockchip, armada-370-xp, meson6, orion, digicolor, 
dw_apb, sun4i, sun5i, tegra2, vt8500, cadence_ttc, asm9260, lpc32xx, 
nomadik_mtu, prcmu, exynos_mct, samsung-pwm and fsl-ftm in order to add 
the COMPILE_TEST option (Daniel Lezcano)

  - Cleanup of the h8300 timers and add the COMPILE_TEST option (Daniel 
Lezcano)

  - Factor out the tango-xtal and the timer_sun5i code by using the 
clocksource_mmio_init (Daniel Lezcano)

  - Fix suspend / resume on the arch_arm_timer (Grygorii Strashko)

  - Implement an ARM delay timer, fix return value and use relaxed io to 
improve performances on the dw_apb_timer (Jisheng Zhang)

  - Improve greatly performances by using writel_relaxed in 
gt_compare_set in the arm_global_timer (Jisheng Zhang)

  - Use the dynamic irq affinity flag on the tegra2 timer (Lucas Stach)

  - Correct pr_err() output format on the lpc32 timer (Vladimir Zapolskiy)

  - Second round of cleanups on the h8300 timers (Yoshinori Sato)

Tested on kernelci.org:
https://kernelci.org/build/dlezcano/kernel/v4.4-rc2-71-gd33f250af4e6/
https://kernelci.org/boot/all/job/dlezcano/kernel/v4.4-rc2-71-gd33f250af4e6/

Thanks !

   -- Daniel


The following changes since commit 82bbe34b3d895fb026b2fc0e7da2e641797bfaed:

   nohz: Clarify magic in tick_nohz_stop_sched_tick() (2015-11-25 
22:37:27 +0100)

are available in the git repository at:

   http://git.linaro.org/people/daniel.lezcano/linux.git kevin-bot

for you to fetch changes up to d33f250af4e67d449f2c748b861ba99d50955469:

   clocksource/drivers/h8300: Use ioread / iowrite (2015-12-16 17:20:13 
+0100)

----------------------------------------------------------------
Alexey Klimov (3):
       clocksource/drivers/mtk_timer: Add pr_fmt define
       clocksource/drivers/mtk_timer: Fix pr_warn() messages in 
mtk_timer_init
       clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()

Caesar Wang (2):
       clocksource/drivers/rockchip: Make the driver more readable
       clocksource/drivers/rockchip: Remove dsb() usage

Daniel Lezcano (49):
       time: Define dummy functions for the generic sched clock
       clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM 
architecture
       clocksource/drivers/st_lpc: Fix Kconfig dependency
       clocksource/drivers/st_lpc: Add the COMPILE_TEST option
       clocksource/drivers/pxa_timer: Move the Kconfig rule
       clocksource/drivers/pxa_timer: Add the COMPILE_TEST option
       clocksource/drivers/tango: Add COMPILE_TEST option
       clocksource/drivers/pistachio: Add the COMPILE_TEST option
       clocksource/drivers/mediatek: Add the COMPILE_TEST option
       clocksource/drivers/rockchip: Add COMPILE_TEST option
       clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option
       clocksource/drivers/meson6: Add the COMPILE_TEST option
       clocksource/drivers/orion: Add the COMPILE_TEST option
       clocksource/drivers/digicolor: Add the COMPILE_TEST option
       clocksource/drivers/dw_apb: Add the COMPILE_TEST option
       clocksource/drivers/sun4i: Add the COMPILE_TEST option
       clocksource/drivers/sun5i: Add the COMPILE_TEST option
       clocksource/drivers/tegra2: Add the COMPILE_TEST option
       clocksource/drivers/vt8500: Remove unneeded header
       clocksource/drivers/vt8500: Add the COMPILE_TEST option
       clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option
       clocksource/drivers/asm9260: Add the COMPILE_TEST option
       clocksource/drivers/lpc32xx: Add the COMPILE_TEST option
       clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option
       clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option
       clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST 
option
       clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option
       clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option
       clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS 
dependency
       clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn
       clocksource/drivers/h8300_tpu: Remove unused macros
       clocksource/drivers/h8300_tpu: Remove pointless headers for TPU
       clocksource/drivers/h8300_timer8: Remove unused headers
       clocksource/drivers/h8300_timer8: Remove unused macros
       clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
       clocksource/drivers/h8300_timer8: Fix irq return value check
       clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant 
safe code
       clocksource/drivers/h8300_timer8: Remove irq and lock legacy code
       clocksource/drivers/h8300_timer8: Retrieve the clock rate at init 
time
       clocksource/drivers/h8300_timer16: Remove pointless headers
       clocksource/drivers/h8300_timer16: Remove unused macros
       clocksource/drivers/h8300_timer16: Remove unused fields in 
timer16_priv
       clocksource/drivers/h8300_timer16: Fix irq return value check
       clocksource/drivers/h8300_timer16: Remove pointless lock
       clocksource/drivers/timer_sun5i: Replace code by 
clocksource_mmio_init
       clocksource/drivers/h8300_timer8: Separate the Kconfig option 
from the arch
       h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]
       clocksource/drivers/h8300: Increase the compilation test coverage
       clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init

Grygorii Strashko (1):
       clocksource/drivers/arm_global_timer: Fix suspend resume

Jisheng Zhang (6):
       clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer
       clocksource/drivers/dw_apb_timer: Fix apbt_readl return types
       clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in 
critical path
       clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
       clockevents/drivers/arm_global_timer: Use writel_relaxed in 
gt_compare_set
       clocksource/drivers/pistachio: Fix wrong calculated clocksource 
read value

Lucas Stach (1):
       clocksource/drivers/tegra: Allow timer irq affinity change

Vladimir Zapolskiy (1):
       clocksource/drivers/lpc32: Correct pr_err() output format

Yoshinori Sato (6):
       clocksource/drivers/h8300: Cleanup startup and remove module code.
       clocksource/drivers/h8300: Change to overflow interrupt
       clocksource/drivers/h8300: Fix timer not overflow case
       clocksource/drivers/h8300: Simplify delta handling
       clocksource/drivers/h8300: Initializer cleanup.
       clocksource/drivers/h8300: Use ioread / iowrite

  arch/arm/Kconfig                       |   3 +++
  arch/arm/mach-exynos/Kconfig           |   1 +
  arch/arm/mach-sti/Kconfig              |   1 +
  arch/arm/mach-ux500/Kconfig            |   1 +
  arch/h8300/Kconfig                     |   1 +
  arch/h8300/include/asm/io.h            |  39 
++++++++++++++++++++--------------
  arch/h8300/kernel/setup.c              |   8 +++----
  drivers/clocksource/Kconfig            | 132 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
  drivers/clocksource/Makefile           |   2 +-
  drivers/clocksource/arm_global_timer.c |  21 +++++++++++++-----
  drivers/clocksource/dw_apb_timer.c     |  46 
+++++++++++++++++++++++++---------------
  drivers/clocksource/dw_apb_timer_of.c  |  16 ++++++++++++++
  drivers/clocksource/h8300_timer16.c    | 222 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------
  drivers/clocksource/h8300_timer8.c     | 264 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------
  drivers/clocksource/h8300_tpu.c        | 159 
++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------
  drivers/clocksource/mtk_timer.c        |  20 ++++++++++--------
  drivers/clocksource/rockchip_timer.c   |  23 +++++++++-----------
  drivers/clocksource/tango_xtal.c       |  18 +++-------------
  drivers/clocksource/tegra20_timer.c    |   3 ++-
  drivers/clocksource/time-lpc32xx.c     |   4 ++--
  drivers/clocksource/time-pistachio.c   |   2 +-
  drivers/clocksource/timer-sun5i.c      |  16 ++------------
  drivers/clocksource/vt8500_timer.c     |   1 -
  drivers/irqchip/irq-renesas-h8300h.c   |   8 +++----
  include/linux/sched_clock.h            |  12 ++++++++---
  25 files changed, 454 insertions(+), 569 deletions(-)

-- 
  <http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 154+ messages in thread

* [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define
  2015-12-17 14:50 ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17   ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

It's a bit unclear what subsystem/driver emits some messages to dmesg in
the function mtk_init_timer(). Use pr_fmt to auto-prefix the messages
appropriately.

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index fbfc746..8f99cd7 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -16,6 +16,8 @@
  * GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define
@ 2015-12-18 14:17   ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

It's a bit unclear what subsystem/driver emits some messages to dmesg in
the function mtk_init_timer(). Use pr_fmt to auto-prefix the messages
appropriately.

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index fbfc746..8f99cd7 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -16,6 +16,8 @@
  * GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define
@ 2015-12-18 14:17   ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexey Klimov <alexey.klimov@linaro.org>

It's a bit unclear what subsystem/driver emits some messages to dmesg in
the function mtk_init_timer(). Use pr_fmt to auto-prefix the messages
appropriately.

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index fbfc746..8f99cd7 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -16,6 +16,8 @@
  * GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
   warnings.
2) Add missing \n.
3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
   There is generic stack_dump() for allocation issues.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index 8f99cd7..e1e0642 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
 	struct clk *clk;
 
 	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
-	if (!evt) {
-		pr_warn("Can't allocate mtk clock event driver struct");
+	if (!evt)
 		return;
-	}
 
 	evt->dev.name = "mtk_tick";
 	evt->dev.rating = 300;
@@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
 
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
-		pr_warn("Can't get resource\n");
+		pr_err("Can't get resource\n");
 		return;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
 	if (evt->dev.irq <= 0) {
-		pr_warn("Can't parse IRQ");
+		pr_err("Can't parse IRQ\n");
 		goto err_mem;
 	}
 
 	clk = of_clk_get(node, 0);
 	if (IS_ERR(clk)) {
-		pr_warn("Can't get timer clock");
+		pr_err("Can't get timer clock\n");
 		goto err_irq;
 	}
 
 	if (clk_prepare_enable(clk)) {
-		pr_warn("Can't prepare clock");
+		pr_err("Can't prepare clock\n");
 		goto err_clk_put;
 	}
 	rate = clk_get_rate(clk);
 
 	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
 			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
-		pr_warn("failed to setup irq %d\n", evt->dev.irq);
+		pr_err("failed to setup irq %d\n", evt->dev.irq);
 		goto err_clk_disable;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, moderated list:ARM/Mediatek SoC...,
	Matthias Brugger, mingo, linux-arm-kernel, Alexey Klimov

From: Alexey Klimov <alexey.klimov@linaro.org>

1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
   warnings.
2) Add missing \n.
3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
   There is generic stack_dump() for allocation issues.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index 8f99cd7..e1e0642 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
 	struct clk *clk;
 
 	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
-	if (!evt) {
-		pr_warn("Can't allocate mtk clock event driver struct");
+	if (!evt)
 		return;
-	}
 
 	evt->dev.name = "mtk_tick";
 	evt->dev.rating = 300;
@@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
 
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
-		pr_warn("Can't get resource\n");
+		pr_err("Can't get resource\n");
 		return;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
 	if (evt->dev.irq <= 0) {
-		pr_warn("Can't parse IRQ");
+		pr_err("Can't parse IRQ\n");
 		goto err_mem;
 	}
 
 	clk = of_clk_get(node, 0);
 	if (IS_ERR(clk)) {
-		pr_warn("Can't get timer clock");
+		pr_err("Can't get timer clock\n");
 		goto err_irq;
 	}
 
 	if (clk_prepare_enable(clk)) {
-		pr_warn("Can't prepare clock");
+		pr_err("Can't prepare clock\n");
 		goto err_clk_put;
 	}
 	rate = clk_get_rate(clk);
 
 	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
 			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
-		pr_warn("failed to setup irq %d\n", evt->dev.irq);
+		pr_err("failed to setup irq %d\n", evt->dev.irq);
 		goto err_clk_disable;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexey Klimov <alexey.klimov@linaro.org>

1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
   warnings.
2) Add missing \n.
3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
   There is generic stack_dump() for allocation issues.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index 8f99cd7..e1e0642 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
 	struct clk *clk;
 
 	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
-	if (!evt) {
-		pr_warn("Can't allocate mtk clock event driver struct");
+	if (!evt)
 		return;
-	}
 
 	evt->dev.name = "mtk_tick";
 	evt->dev.rating = 300;
@@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
 
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
-		pr_warn("Can't get resource\n");
+		pr_err("Can't get resource\n");
 		return;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
 	if (evt->dev.irq <= 0) {
-		pr_warn("Can't parse IRQ");
+		pr_err("Can't parse IRQ\n");
 		goto err_mem;
 	}
 
 	clk = of_clk_get(node, 0);
 	if (IS_ERR(clk)) {
-		pr_warn("Can't get timer clock");
+		pr_err("Can't get timer clock\n");
 		goto err_irq;
 	}
 
 	if (clk_prepare_enable(clk)) {
-		pr_warn("Can't prepare clock");
+		pr_err("Can't prepare clock\n");
 		goto err_clk_put;
 	}
 	rate = clk_get_rate(clk);
 
 	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
 			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
-		pr_warn("failed to setup irq %d\n", evt->dev.irq);
+		pr_err("failed to setup irq %d\n", evt->dev.irq);
 		goto err_clk_disable;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

Add error path to clear evt struct allocated by kzalloc() in the beginning of
function mtk_timer_init().

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index e1e0642..d67bc35 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -205,7 +205,7 @@ static void __init mtk_timer_init(struct device_node *node)
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
 		pr_err("Can't get resource\n");
-		return;
+		goto err_kzalloc;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
@@ -260,5 +260,7 @@ err_mem:
 	iounmap(evt->gpt_base);
 	of_address_to_resource(node, 0, &res);
 	release_mem_region(res.start, resource_size(&res));
+err_kzalloc:
+	kfree(evt);
 }
 CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

Add error path to clear evt struct allocated by kzalloc() in the beginning of
function mtk_timer_init().

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index e1e0642..d67bc35 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -205,7 +205,7 @@ static void __init mtk_timer_init(struct device_node *node)
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
 		pr_err("Can't get resource\n");
-		return;
+		goto err_kzalloc;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
@@ -260,5 +260,7 @@ err_mem:
 	iounmap(evt->gpt_base);
 	of_address_to_resource(node, 0, &res);
 	release_mem_region(res.start, resource_size(&res));
+err_kzalloc:
+	kfree(evt);
 }
 CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexey Klimov <alexey.klimov@linaro.org>

Add error path to clear evt struct allocated by kzalloc() in the beginning of
function mtk_timer_init().

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index e1e0642..d67bc35 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -205,7 +205,7 @@ static void __init mtk_timer_init(struct device_node *node)
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
 		pr_err("Can't get resource\n");
-		return;
+		goto err_kzalloc;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
@@ -260,5 +260,7 @@ err_mem:
 	iounmap(evt->gpt_base);
 	of_address_to_resource(node, 0, &res);
 	release_mem_region(res.start, resource_size(&res));
+err_kzalloc:
+	kfree(evt);
 }
 CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 04/69] clocksource/drivers/tegra: Allow timer irq affinity change
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: Alexandre Courbot, Lucas Stach, Stephen Warren, linux-kernel,
	Thierry Reding, open list:TEGRA ARCHITECTUR...,
	mingo, linux-arm-kernel

From: Lucas Stach <dev@lynxeye.de>

Allow the timer core to change the smp affinity of the broadcast timer
irq by setting CLOCK_EVT_FEAT_DYNIRQ flag.

This reduces interrupt pressure and wakeups on CPU0 as well as vastly
reducing the number of timer broadcast IPIs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/tegra20_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index 6ebda11..38333ab 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -96,7 +96,8 @@ static struct clock_event_device tegra_clockevent = {
 	.name			= "timer0",
 	.rating			= 300,
 	.features		= CLOCK_EVT_FEAT_ONESHOT |
-				  CLOCK_EVT_FEAT_PERIODIC,
+				  CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_DYNIRQ,
 	.set_next_event		= tegra_timer_set_next_event,
 	.set_state_shutdown	= tegra_timer_shutdown,
 	.set_state_periodic	= tegra_timer_set_periodic,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 04/69] clocksource/drivers/tegra: Allow timer irq affinity change
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Lucas Stach,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	open list:TEGRA ARCHITECTUR...

From: Lucas Stach <dev@lynxeye.de>

Allow the timer core to change the smp affinity of the broadcast timer
irq by setting CLOCK_EVT_FEAT_DYNIRQ flag.

This reduces interrupt pressure and wakeups on CPU0 as well as vastly
reducing the number of timer broadcast IPIs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/tegra20_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index 6ebda11..38333ab 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -96,7 +96,8 @@ static struct clock_event_device tegra_clockevent = {
 	.name			= "timer0",
 	.rating			= 300,
 	.features		= CLOCK_EVT_FEAT_ONESHOT |
-				  CLOCK_EVT_FEAT_PERIODIC,
+				  CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_DYNIRQ,
 	.set_next_event		= tegra_timer_set_next_event,
 	.set_state_shutdown	= tegra_timer_shutdown,
 	.set_state_periodic	= tegra_timer_set_periodic,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 04/69] clocksource/drivers/tegra: Allow timer irq affinity change
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lucas Stach <dev@lynxeye.de>

Allow the timer core to change the smp affinity of the broadcast timer
irq by setting CLOCK_EVT_FEAT_DYNIRQ flag.

This reduces interrupt pressure and wakeups on CPU0 as well as vastly
reducing the number of timer broadcast IPIs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/tegra20_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index 6ebda11..38333ab 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -96,7 +96,8 @@ static struct clock_event_device tegra_clockevent = {
 	.name			= "timer0",
 	.rating			= 300,
 	.features		= CLOCK_EVT_FEAT_ONESHOT |
-				  CLOCK_EVT_FEAT_PERIODIC,
+				  CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_DYNIRQ,
 	.set_next_event		= tegra_timer_set_next_event,
 	.set_state_shutdown	= tegra_timer_shutdown,
 	.set_state_periodic	= tegra_timer_set_periodic,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 05/69] clocksource/drivers/rockchip: Make the driver more readable
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Caesar Wang,
	Heiko Stuebner, open list:ARM/Rockchip SoC...

From: Caesar Wang <wxt@rock-chips.com>

Let's checkstyle to clean up the macros with such trivial details.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/rockchip_timer.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index d3c1742..b14716b6 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -17,16 +17,16 @@
 
 #define TIMER_NAME "rk_timer"
 
-#define TIMER_LOAD_COUNT0 0x00
-#define TIMER_LOAD_COUNT1 0x04
-#define TIMER_CONTROL_REG 0x10
-#define TIMER_INT_STATUS 0x18
+#define TIMER_LOAD_COUNT0	0x00
+#define TIMER_LOAD_COUNT1	0x04
+#define TIMER_CONTROL_REG	0x10
+#define TIMER_INT_STATUS	0x18
 
-#define TIMER_DISABLE 0x0
-#define TIMER_ENABLE 0x1
-#define TIMER_MODE_FREE_RUNNING (0 << 1)
-#define TIMER_MODE_USER_DEFINED_COUNT (1 << 1)
-#define TIMER_INT_UNMASK (1 << 2)
+#define TIMER_DISABLE		0x0
+#define TIMER_ENABLE		0x1
+#define TIMER_MODE_FREE_RUNNING			(0 << 1)
+#define TIMER_MODE_USER_DEFINED_COUNT		(1 << 1)
+#define TIMER_INT_UNMASK			(1 << 2)
 
 struct bc_timer {
 	struct clock_event_device ce;
@@ -173,4 +173,5 @@ static void __init rk_timer_init(struct device_node *np)
 
 	clockevents_config_and_register(ce, bc_timer.freq, 1, UINT_MAX);
 }
+
 CLOCKSOURCE_OF_DECLARE(rk_timer, "rockchip,rk3288-timer", rk_timer_init);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 05/69] clocksource/drivers/rockchip: Make the driver more readable
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Caesar Wang,
	Heiko Stuebner, open list:ARM/Rockchip SoC...

From: Caesar Wang <wxt@rock-chips.com>

Let's checkstyle to clean up the macros with such trivial details.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/rockchip_timer.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index d3c1742..b14716b6 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -17,16 +17,16 @@
 
 #define TIMER_NAME "rk_timer"
 
-#define TIMER_LOAD_COUNT0 0x00
-#define TIMER_LOAD_COUNT1 0x04
-#define TIMER_CONTROL_REG 0x10
-#define TIMER_INT_STATUS 0x18
+#define TIMER_LOAD_COUNT0	0x00
+#define TIMER_LOAD_COUNT1	0x04
+#define TIMER_CONTROL_REG	0x10
+#define TIMER_INT_STATUS	0x18
 
-#define TIMER_DISABLE 0x0
-#define TIMER_ENABLE 0x1
-#define TIMER_MODE_FREE_RUNNING (0 << 1)
-#define TIMER_MODE_USER_DEFINED_COUNT (1 << 1)
-#define TIMER_INT_UNMASK (1 << 2)
+#define TIMER_DISABLE		0x0
+#define TIMER_ENABLE		0x1
+#define TIMER_MODE_FREE_RUNNING			(0 << 1)
+#define TIMER_MODE_USER_DEFINED_COUNT		(1 << 1)
+#define TIMER_INT_UNMASK			(1 << 2)
 
 struct bc_timer {
 	struct clock_event_device ce;
@@ -173,4 +173,5 @@ static void __init rk_timer_init(struct device_node *np)
 
 	clockevents_config_and_register(ce, bc_timer.freq, 1, UINT_MAX);
 }
+
 CLOCKSOURCE_OF_DECLARE(rk_timer, "rockchip,rk3288-timer", rk_timer_init);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 05/69] clocksource/drivers/rockchip: Make the driver more readable
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Caesar Wang <wxt@rock-chips.com>

Let's checkstyle to clean up the macros with such trivial details.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/rockchip_timer.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index d3c1742..b14716b6 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -17,16 +17,16 @@
 
 #define TIMER_NAME "rk_timer"
 
-#define TIMER_LOAD_COUNT0 0x00
-#define TIMER_LOAD_COUNT1 0x04
-#define TIMER_CONTROL_REG 0x10
-#define TIMER_INT_STATUS 0x18
+#define TIMER_LOAD_COUNT0	0x00
+#define TIMER_LOAD_COUNT1	0x04
+#define TIMER_CONTROL_REG	0x10
+#define TIMER_INT_STATUS	0x18
 
-#define TIMER_DISABLE 0x0
-#define TIMER_ENABLE 0x1
-#define TIMER_MODE_FREE_RUNNING (0 << 1)
-#define TIMER_MODE_USER_DEFINED_COUNT (1 << 1)
-#define TIMER_INT_UNMASK (1 << 2)
+#define TIMER_DISABLE		0x0
+#define TIMER_ENABLE		0x1
+#define TIMER_MODE_FREE_RUNNING			(0 << 1)
+#define TIMER_MODE_USER_DEFINED_COUNT		(1 << 1)
+#define TIMER_INT_UNMASK			(1 << 2)
 
 struct bc_timer {
 	struct clock_event_device ce;
@@ -173,4 +173,5 @@ static void __init rk_timer_init(struct device_node *np)
 
 	clockevents_config_and_register(ce, bc_timer.freq, 1, UINT_MAX);
 }
+
 CLOCKSOURCE_OF_DECLARE(rk_timer, "rockchip,rk3288-timer", rk_timer_init);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 06/69] time: Define dummy functions for the generic sched clock
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

When we try to compile a clocksource driver with the COMPILE_TEST option,
we can't select the GENERIC_SCHED_CLOCK because the sched_clock() symbol
will be duplicated with the one defined for the x86.

In order to fix that, we don't select the GENERIC_SCHED_CLOCK in the
driver Kconfig's file but we define some empty functions for the different
symbols in order to prevent the unresolved ones.

This patch fixes the COMPILE_TEST option for the compile test coverage for
the clocksource drivers. Without this patch, we can't add the COMPILE_TEST
option for the clocksource drivers using the GENERIC_SCHED_CLOCK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/sched_clock.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h
index efa931c..411b52e 100644
--- a/include/linux/sched_clock.h
+++ b/include/linux/sched_clock.h
@@ -10,11 +10,17 @@
 
 #ifdef CONFIG_GENERIC_SCHED_CLOCK
 extern void sched_clock_postinit(void);
-#else
-static inline void sched_clock_postinit(void) { }
-#endif
 
 extern void sched_clock_register(u64 (*read)(void), int bits,
 				 unsigned long rate);
+#else
+static inline void sched_clock_postinit(void) { }
+
+static inline void sched_clock_register(u64 (*read)(void), int bits,
+					unsigned long rate)
+{
+	;
+}
+#endif
 
 #endif
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 06/69] time: Define dummy functions for the generic sched clock
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

When we try to compile a clocksource driver with the COMPILE_TEST option,
we can't select the GENERIC_SCHED_CLOCK because the sched_clock() symbol
will be duplicated with the one defined for the x86.

In order to fix that, we don't select the GENERIC_SCHED_CLOCK in the
driver Kconfig's file but we define some empty functions for the different
symbols in order to prevent the unresolved ones.

This patch fixes the COMPILE_TEST option for the compile test coverage for
the clocksource drivers. Without this patch, we can't add the COMPILE_TEST
option for the clocksource drivers using the GENERIC_SCHED_CLOCK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/sched_clock.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h
index efa931c..411b52e 100644
--- a/include/linux/sched_clock.h
+++ b/include/linux/sched_clock.h
@@ -10,11 +10,17 @@
 
 #ifdef CONFIG_GENERIC_SCHED_CLOCK
 extern void sched_clock_postinit(void);
-#else
-static inline void sched_clock_postinit(void) { }
-#endif
 
 extern void sched_clock_register(u64 (*read)(void), int bits,
 				 unsigned long rate);
+#else
+static inline void sched_clock_postinit(void) { }
+
+static inline void sched_clock_register(u64 (*read)(void), int bits,
+					unsigned long rate)
+{
+	;
+}
+#endif
 
 #endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 07/69] clocksource/drivers/rockchip: Remove dsb() usage
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Caesar Wang,
	Heiko Stuebner, open list:ARM/Rockchip SoC...

From: Caesar Wang <wxt@rock-chips.com>

The dsb() instruction is pointless in this code.

Remove it.

That also fixes the ARM64 compilation issue.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
---
 drivers/clocksource/rockchip_timer.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index b14716b6..8c77a52 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -49,14 +49,12 @@ static inline void __iomem *rk_base(struct clock_event_device *ce)
 static inline void rk_timer_disable(struct clock_event_device *ce)
 {
 	writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static inline void rk_timer_enable(struct clock_event_device *ce, u32 flags)
 {
 	writel_relaxed(TIMER_ENABLE | TIMER_INT_UNMASK | flags,
 		       rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static void rk_timer_update_counter(unsigned long cycles,
@@ -64,13 +62,11 @@ static void rk_timer_update_counter(unsigned long cycles,
 {
 	writel_relaxed(cycles, rk_base(ce) + TIMER_LOAD_COUNT0);
 	writel_relaxed(0, rk_base(ce) + TIMER_LOAD_COUNT1);
-	dsb();
 }
 
 static void rk_timer_interrupt_clear(struct clock_event_device *ce)
 {
 	writel_relaxed(1, rk_base(ce) + TIMER_INT_STATUS);
-	dsb();
 }
 
 static inline int rk_timer_set_next_event(unsigned long cycles,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 07/69] clocksource/drivers/rockchip: Remove dsb() usage
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Caesar Wang,
	Heiko Stuebner, open list:ARM/Rockchip SoC...

From: Caesar Wang <wxt@rock-chips.com>

The dsb() instruction is pointless in this code.

Remove it.

That also fixes the ARM64 compilation issue.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
---
 drivers/clocksource/rockchip_timer.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index b14716b6..8c77a52 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -49,14 +49,12 @@ static inline void __iomem *rk_base(struct clock_event_device *ce)
 static inline void rk_timer_disable(struct clock_event_device *ce)
 {
 	writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static inline void rk_timer_enable(struct clock_event_device *ce, u32 flags)
 {
 	writel_relaxed(TIMER_ENABLE | TIMER_INT_UNMASK | flags,
 		       rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static void rk_timer_update_counter(unsigned long cycles,
@@ -64,13 +62,11 @@ static void rk_timer_update_counter(unsigned long cycles,
 {
 	writel_relaxed(cycles, rk_base(ce) + TIMER_LOAD_COUNT0);
 	writel_relaxed(0, rk_base(ce) + TIMER_LOAD_COUNT1);
-	dsb();
 }
 
 static void rk_timer_interrupt_clear(struct clock_event_device *ce)
 {
 	writel_relaxed(1, rk_base(ce) + TIMER_INT_STATUS);
-	dsb();
 }
 
 static inline int rk_timer_set_next_event(unsigned long cycles,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 07/69] clocksource/drivers/rockchip: Remove dsb() usage
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Caesar Wang <wxt@rock-chips.com>

The dsb() instruction is pointless in this code.

Remove it.

That also fixes the ARM64 compilation issue.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
---
 drivers/clocksource/rockchip_timer.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
index b14716b6..8c77a52 100644
--- a/drivers/clocksource/rockchip_timer.c
+++ b/drivers/clocksource/rockchip_timer.c
@@ -49,14 +49,12 @@ static inline void __iomem *rk_base(struct clock_event_device *ce)
 static inline void rk_timer_disable(struct clock_event_device *ce)
 {
 	writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static inline void rk_timer_enable(struct clock_event_device *ce, u32 flags)
 {
 	writel_relaxed(TIMER_ENABLE | TIMER_INT_UNMASK | flags,
 		       rk_base(ce) + TIMER_CONTROL_REG);
-	dsb();
 }
 
 static void rk_timer_update_counter(unsigned long cycles,
@@ -64,13 +62,11 @@ static void rk_timer_update_counter(unsigned long cycles,
 {
 	writel_relaxed(cycles, rk_base(ce) + TIMER_LOAD_COUNT0);
 	writel_relaxed(0, rk_base(ce) + TIMER_LOAD_COUNT1);
-	dsb();
 }
 
 static void rk_timer_interrupt_clear(struct clock_event_device *ce)
 {
 	writel_relaxed(1, rk_base(ce) + TIMER_INT_STATUS);
-	dsb();
 }
 
 static inline int rk_timer_set_next_event(unsigned long cycles,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 08/69] clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM architecture
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

In order to be consistent with the rest of the drivers compilation, let's
introduce the COMPILE_TEST option. Unfortunately, the delay.h code is not
portable, so the compilation test coverage will be restricted to the ARM
architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 2eb5f0e..b423785 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -279,7 +279,12 @@ config EM_TIMER_STI
 	  such as EMEV2 from former NEC Electronics.
 
 config CLKSRC_QCOM
-	bool
+	bool "Qualcomm MSM timer" if COMPILE_TEST
+	depends on ARM
+	select CLKSRC_OF
+	help
+	  This enables the clocksource and the per CPU clockevent driver for the
+	  Qualcomm SoCs.
 
 config CLKSRC_VERSATILE
 	bool "ARM Versatile (Express) reference platforms clock source"
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 08/69] clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM architecture
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

In order to be consistent with the rest of the drivers compilation, let's
introduce the COMPILE_TEST option. Unfortunately, the delay.h code is not
portable, so the compilation test coverage will be restricted to the ARM
architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 2eb5f0e..b423785 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -279,7 +279,12 @@ config EM_TIMER_STI
 	  such as EMEV2 from former NEC Electronics.
 
 config CLKSRC_QCOM
-	bool
+	bool "Qualcomm MSM timer" if COMPILE_TEST
+	depends on ARM
+	select CLKSRC_OF
+	help
+	  This enables the clocksource and the per CPU clockevent driver for the
+	  Qualcomm SoCs.
 
 config CLKSRC_VERSATILE
 	bool "ARM Versatile (Express) reference platforms clock source"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 09/69] clocksource/drivers/st_lpc: Fix Kconfig dependency
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Maxime Coquelin,
	Srinivas Kandagatla, Patrice Chotard, Russell King,
	open list:ARM/STI ARCHITECTURE

Change the Kconfig selection rule by letting the STI arch to select
the timer.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
---
 arch/arm/mach-sti/Kconfig   | 1 +
 drivers/clocksource/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index 125865d..12dd1dc 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -3,6 +3,7 @@ menuconfig ARCH_STI
 	select ARM_GIC
 	select ST_IRQCHIP
 	select ARM_GLOBAL_TIMER
+	select CLKSRC_ST_LPC
 	select PINCTRL
 	select PINCTRL_ST
 	select MFD_SYSCON
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b423785..3594a2b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -326,7 +326,6 @@ config CLKSRC_IMX_GPT
 
 config CLKSRC_ST_LPC
 	bool
-	depends on ARCH_STI
 	select CLKSRC_OF if OF
 	help
 	  Enable this option to use the Low Power controller timer
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 09/69] clocksource/drivers/st_lpc: Fix Kconfig dependency
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Change the Kconfig selection rule by letting the STI arch to select
the timer.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
---
 arch/arm/mach-sti/Kconfig   | 1 +
 drivers/clocksource/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index 125865d..12dd1dc 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -3,6 +3,7 @@ menuconfig ARCH_STI
 	select ARM_GIC
 	select ST_IRQCHIP
 	select ARM_GLOBAL_TIMER
+	select CLKSRC_ST_LPC
 	select PINCTRL
 	select PINCTRL_ST
 	select MFD_SYSCON
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b423785..3594a2b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -326,7 +326,6 @@ config CLKSRC_IMX_GPT
 
 config CLKSRC_ST_LPC
 	bool
-	depends on ARCH_STI
 	select CLKSRC_OF if OF
 	help
 	  Enable this option to use the Low Power controller timer
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 10/69] clocksource/drivers/st_lpc: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3594a2b..4117386 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -325,7 +325,7 @@ config CLKSRC_IMX_GPT
 	select CLKSRC_MMIO
 
 config CLKSRC_ST_LPC
-	bool
+	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select CLKSRC_OF if OF
 	help
 	  Enable this option to use the Low Power controller timer
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 10/69] clocksource/drivers/st_lpc: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3594a2b..4117386 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -325,7 +325,7 @@ config CLKSRC_IMX_GPT
 	select CLKSRC_MMIO
 
 config CLKSRC_ST_LPC
-	bool
+	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select CLKSRC_OF if OF
 	help
 	  Enable this option to use the Low Power controller timer
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 11/69] clocksource/drivers/pxa_timer: Move the Kconfig rule
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Russell King

Instead of having the clocksource's Kconfig depending on the arch, let the
arch to select the timer it needs.

The CLKSRC_OF dependency is removed because already selected by the
ARCH_PXA, and it is added for SA1100.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/Kconfig            | 3 +++
 drivers/clocksource/Kconfig | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0365cbb..a5d416e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -609,6 +609,7 @@ config ARCH_PXA
 	select AUTO_ZRELADDR
 	select COMMON_CLK
 	select CLKDEV_LOOKUP
+	select CLKSRC_PXA
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	select GENERIC_CLOCKEVENTS
@@ -648,6 +649,8 @@ config ARCH_SA1100
 	select ARCH_SPARSEMEM_ENABLE
 	select CLKDEV_LOOKUP
 	select CLKSRC_MMIO
+	select CLKSRC_PXA
+	select CLKSRC_OF if OF
 	select CPU_FREQ
 	select CPU_SA1100
 	select GENERIC_CLOCKEVENTS
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 4117386..d4221e0 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -307,8 +307,7 @@ config CLKSRC_TANGO_XTAL
 	select CLKSRC_OF
 
 config CLKSRC_PXA
-	def_bool y if ARCH_PXA || ARCH_SA1100
-	select CLKSRC_OF if OF
+	bool
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 11/69] clocksource/drivers/pxa_timer: Move the Kconfig rule
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of having the clocksource's Kconfig depending on the arch, let the
arch to select the timer it needs.

The CLKSRC_OF dependency is removed because already selected by the
ARCH_PXA, and it is added for SA1100.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/Kconfig            | 3 +++
 drivers/clocksource/Kconfig | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0365cbb..a5d416e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -609,6 +609,7 @@ config ARCH_PXA
 	select AUTO_ZRELADDR
 	select COMMON_CLK
 	select CLKDEV_LOOKUP
+	select CLKSRC_PXA
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	select GENERIC_CLOCKEVENTS
@@ -648,6 +649,8 @@ config ARCH_SA1100
 	select ARCH_SPARSEMEM_ENABLE
 	select CLKDEV_LOOKUP
 	select CLKSRC_MMIO
+	select CLKSRC_PXA
+	select CLKSRC_OF if OF
 	select CPU_FREQ
 	select CPU_SA1100
 	select GENERIC_CLOCKEVENTS
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 4117386..d4221e0 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -307,8 +307,7 @@ config CLKSRC_TANGO_XTAL
 	select CLKSRC_OF
 
 config CLKSRC_PXA
-	def_bool y if ARCH_PXA || ARCH_SA1100
-	select CLKSRC_OF if OF
+	bool
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 12/69] clocksource/drivers/pxa_timer: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index d4221e0..e07ada9 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -307,7 +307,9 @@ config CLKSRC_TANGO_XTAL
 	select CLKSRC_OF
 
 config CLKSRC_PXA
-	bool
+	bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
+	select CLKSRC_MMIO
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 12/69] clocksource/drivers/pxa_timer: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index d4221e0..e07ada9 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -307,7 +307,9 @@ config CLKSRC_TANGO_XTAL
 	select CLKSRC_OF
 
 config CLKSRC_PXA
-	bool
+	bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
+	select CLKSRC_MMIO
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 13/69] clocksource/drivers/tango: Add COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e07ada9..8ea7140 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -303,8 +303,11 @@ config CLKSRC_MIPS_GIC
 	select CLKSRC_OF
 
 config CLKSRC_TANGO_XTAL
-	bool
+	bool "Clocksource for Tango SoC" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
+	help
+	  This enables the clocksource for Tango SoC
 
 config CLKSRC_PXA
 	bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 13/69] clocksource/drivers/tango: Add COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e07ada9..8ea7140 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -303,8 +303,11 @@ config CLKSRC_MIPS_GIC
 	select CLKSRC_OF
 
 config CLKSRC_TANGO_XTAL
-	bool
+	bool "Clocksource for Tango SoC" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
+	help
+	  This enables the clocksource for Tango SoC
 
 config CLKSRC_PXA
 	bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 14/69] clocksource/drivers/pistachio: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 8ea7140..96a34dc 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -121,8 +121,10 @@ config CLKSRC_LPC32XX
 	select CLKSRC_OF
 
 config CLKSRC_PISTACHIO
-	bool
+	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
 	select CLKSRC_OF
+	help
+	  Enables the clocksource for the Pistachio SoC.
 
 config CLKSRC_TI_32K
 	bool "Texas Instruments 32.768 Hz Clocksource" if COMPILE_TEST
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 14/69] clocksource/drivers/pistachio: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 8ea7140..96a34dc 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -121,8 +121,10 @@ config CLKSRC_LPC32XX
 	select CLKSRC_OF
 
 config CLKSRC_PISTACHIO
-	bool
+	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
 	select CLKSRC_OF
+	help
+	  Enables the clocksource for the Pistachio SoC.
 
 config CLKSRC_TI_32K
 	bool "Texas Instruments 32.768 Hz Clocksource" if COMPILE_TEST
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Matthias Brugger,
	moderated list:ARM/Mediatek SoC...

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96a34dc..3ba43f6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
         bool
 
 config MTK_TIMER
+	bool "Mediatek timer driver" if COMPILE_TEST
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Support for Mediatek timer driver.
 
 config SYS_SUPPORTS_SH_MTU2
         bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: Matthias Brugger, moderated list:ARM/Mediatek SoC...,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mingo-DgEjT+Ai2ygdnm+yROfE0A

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96a34dc..3ba43f6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
         bool
 
 config MTK_TIMER
+	bool "Mediatek timer driver" if COMPILE_TEST
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Support for Mediatek timer driver.
 
 config SYS_SUPPORTS_SH_MTU2
         bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96a34dc..3ba43f6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
         bool
 
 config MTK_TIMER
+	bool "Mediatek timer driver" if COMPILE_TEST
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Support for Mediatek timer driver.
 
 config SYS_SUPPORTS_SH_MTU2
         bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 16/69] clocksource/drivers/rockchip: Add COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the dsb() usage in the driver, this driver is only compilable on
ARM and ARM64.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3ba43f6..0c06103 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -39,8 +39,11 @@ config DW_APB_TIMER_OF
 	select CLKSRC_OF
 
 config ROCKCHIP_TIMER
-	bool
+	bool "Rockchip timer driver" if COMPILE_TEST
+	depends on ARM || ARM64
 	select CLKSRC_OF
+	help
+	  Enables the support for the rockchip timer driver.
 
 config ARMADA_370_XP_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 16/69] clocksource/drivers/rockchip: Add COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the dsb() usage in the driver, this driver is only compilable on
ARM and ARM64.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3ba43f6..0c06103 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -39,8 +39,11 @@ config DW_APB_TIMER_OF
 	select CLKSRC_OF
 
 config ROCKCHIP_TIMER
-	bool
+	bool "Rockchip timer driver" if COMPILE_TEST
+	depends on ARM || ARM64
 	select CLKSRC_OF
+	help
+	  Enables the support for the rockchip timer driver.
 
 config ARMADA_370_XP_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 17/69] clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable 'delay' code, the compilation is restricted to the
ARM architecture only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 0c06103..b6bb0a6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -46,8 +46,11 @@ config ROCKCHIP_TIMER
 	  Enables the support for the rockchip timer driver.
 
 config ARMADA_370_XP_TIMER
-	bool
+	bool "Armada 370 and XP timer driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
+	help
+	  Enables the support for the Armada 370 and XP timer driver.
 
 config MESON6_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 17/69] clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable 'delay' code, the compilation is restricted to the
ARM architecture only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 0c06103..b6bb0a6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -46,8 +46,11 @@ config ROCKCHIP_TIMER
 	  Enables the support for the rockchip timer driver.
 
 config ARMADA_370_XP_TIMER
-	bool
+	bool "Armada 370 and XP timer driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
+	help
+	  Enables the support for the Armada 370 and XP timer driver.
 
 config MESON6_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 18/69] clocksource/drivers/meson6: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b6bb0a6..f6e71b7 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -53,8 +53,10 @@ config ARMADA_370_XP_TIMER
 	  Enables the support for the Armada 370 and XP timer driver.
 
 config MESON6_TIMER
-	bool
+	bool "Meson6 timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
+	help
+	  Enables the support for the Meson6 timer driver.
 
 config ORION_TIMER
 	select CLKSRC_OF
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 18/69] clocksource/drivers/meson6: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b6bb0a6..f6e71b7 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -53,8 +53,10 @@ config ARMADA_370_XP_TIMER
 	  Enables the support for the Armada 370 and XP timer driver.
 
 config MESON6_TIMER
-	bool
+	bool "Meson6 timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
+	help
+	  Enables the support for the Meson6 timer driver.
 
 config ORION_TIMER
 	select CLKSRC_OF
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 19/69] clocksource/drivers/orion: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver is using the atomic_io API which is not portable, so the
compilation is restricted to ARM only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index f6e71b7..68a63b2 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -59,9 +59,12 @@ config MESON6_TIMER
 	  Enables the support for the Meson6 timer driver.
 
 config ORION_TIMER
+	bool "Orion timer driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Enables the support for the Orion timer driver
 
 config SUN4I_TIMER
 	select CLKSRC_MMIO
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 19/69] clocksource/drivers/orion: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver is using the atomic_io API which is not portable, so the
compilation is restricted to ARM only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index f6e71b7..68a63b2 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -59,9 +59,12 @@ config MESON6_TIMER
 	  Enables the support for the Meson6 timer driver.
 
 config ORION_TIMER
+	bool "Orion timer driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Enables the support for the Orion timer driver
 
 config SUN4I_TIMER
 	select CLKSRC_MMIO
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 20/69] clocksource/drivers/digicolor: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 68a63b2..63a8c6f 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -28,7 +28,9 @@ config CLKSRC_MMIO
 	bool
 
 config DIGICOLOR_TIMER
-	bool
+	bool "Digicolor timer driver" if COMPILE_TEST
+	help
+	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 20/69] clocksource/drivers/digicolor: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 68a63b2..63a8c6f 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -28,7 +28,9 @@ config CLKSRC_MMIO
 	bool
 
 config DIGICOLOR_TIMER
-	bool
+	bool "Digicolor timer driver" if COMPILE_TEST
+	help
+	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 21/69] clocksource/drivers/dw_apb: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 63a8c6f..24a8d8d 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -33,7 +33,9 @@ config DIGICOLOR_TIMER
 	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
-	bool
+	bool "DW APB timer driver" if COMPILE_TEST
+	help
+	  Enables the support for the dw_apb timer.
 
 config DW_APB_TIMER_OF
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 21/69] clocksource/drivers/dw_apb: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 63a8c6f..24a8d8d 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -33,7 +33,9 @@ config DIGICOLOR_TIMER
 	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
-	bool
+	bool "DW APB timer driver" if COMPILE_TEST
+	help
+	  Enables the support for the dw_apb timer.
 
 config DW_APB_TIMER_OF
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 22/69] clocksource/drivers/sun4i: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 24a8d8d..67be8f4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -71,8 +71,10 @@ config ORION_TIMER
 	  Enables the support for the Orion timer driver
 
 config SUN4I_TIMER
+	bool "Sun4i timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
-	bool
+	help
+	  Enables support for the Sun4i timer.
 
 config SUN5I_HSTIMER
 	select CLKSRC_MMIO
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 22/69] clocksource/drivers/sun4i: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 24a8d8d..67be8f4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -71,8 +71,10 @@ config ORION_TIMER
 	  Enables the support for the Orion timer driver
 
 config SUN4I_TIMER
+	bool "Sun4i timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
-	bool
+	help
+	  Enables support for the Sun4i timer.
 
 config SUN5I_HSTIMER
 	select CLKSRC_MMIO
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 23/69] clocksource/drivers/sun5i: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver depends on the common clock framework, thus the dependency added
on COMMON_CLK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 67be8f4..625d459 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -77,8 +77,11 @@ config SUN4I_TIMER
 	  Enables support for the Sun4i timer.
 
 config SUN5I_HSTIMER
+	bool "Sun5i timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
-	bool
+	depends on COMMON_CLK
+	help
+	  Enables support the Sun5i timer.
 
 config TEGRA_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 23/69] clocksource/drivers/sun5i: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver depends on the common clock framework, thus the dependency added
on COMMON_CLK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 67be8f4..625d459 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -77,8 +77,11 @@ config SUN4I_TIMER
 	  Enables support for the Sun4i timer.
 
 config SUN5I_HSTIMER
+	bool "Sun5i timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
-	bool
+	depends on COMMON_CLK
+	help
+	  Enables support the Sun5i timer.
 
 config TEGRA_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 24/69] clocksource/drivers/tegra2: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable code for the delay timer, this option is only
available for the ARM architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 625d459..e33ed76 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -84,7 +84,10 @@ config SUN5I_HSTIMER
 	  Enables support the Sun5i timer.
 
 config TEGRA_TIMER
-	bool
+	bool "Tegra timer driver" if COMPILE_TEST
+	depends on ARM
+	help
+	  Enables support for the Tegra driver.
 
 config VT8500_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 24/69] clocksource/drivers/tegra2: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable code for the delay timer, this option is only
available for the ARM architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 625d459..e33ed76 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -84,7 +84,10 @@ config SUN5I_HSTIMER
 	  Enables support the Sun5i timer.
 
 config TEGRA_TIMER
-	bool
+	bool "Tegra timer driver" if COMPILE_TEST
+	depends on ARM
+	help
+	  Enables support for the Tegra driver.
 
 config VT8500_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 25/69] clocksource/drivers/vt8500: Remove unneeded header
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Tony Prisk

Remove the <asm/time.h> header inclusion which is pointless.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/vt8500_timer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index a92e94b..de49805 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -30,7 +30,6 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/delay.h>
-#include <asm/mach/time.h>
 
 #include <linux/of.h>
 #include <linux/of_address.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 25/69] clocksource/drivers/vt8500: Remove unneeded header
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Remove the <asm/time.h> header inclusion which is pointless.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/vt8500_timer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index a92e94b..de49805 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -30,7 +30,6 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/delay.h>
-#include <asm/mach/time.h>
 
 #include <linux/of.h>
 #include <linux/of_address.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 26/69] clocksource/drivers/vt8500: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e33ed76..c2b87b4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -90,7 +90,9 @@ config TEGRA_TIMER
 	  Enables support for the Tegra driver.
 
 config VT8500_TIMER
-	bool
+	bool "VT8500 timer driver" if COMPILE_TEST
+	help
+	  Enables support for the VT8500 driver.
 
 config CADENCE_TTC_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 26/69] clocksource/drivers/vt8500: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e33ed76..c2b87b4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -90,7 +90,9 @@ config TEGRA_TIMER
 	  Enables support for the Tegra driver.
 
 config VT8500_TIMER
-	bool
+	bool "VT8500 timer driver" if COMPILE_TEST
+	help
+	  Enables support for the VT8500 driver.
 
 config CADENCE_TTC_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 27/69] clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver depends on the common clock framework, thus the dependency added
on COMMON_CLK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index c2b87b4..badef72 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -95,7 +95,10 @@ config VT8500_TIMER
 	  Enables support for the VT8500 driver.
 
 config CADENCE_TTC_TIMER
-	bool
+	bool "Cadence TTC timer driver" if COMPILE_TEST
+	depends on COMMON_CLK
+	help
+	  Enables support for the cadence ttc driver.
 
 config ASM9260_TIMER
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 27/69] clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

The driver depends on the common clock framework, thus the dependency added
on COMMON_CLK.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index c2b87b4..badef72 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -95,7 +95,10 @@ config VT8500_TIMER
 	  Enables support for the VT8500 driver.
 
 config CADENCE_TTC_TIMER
-	bool
+	bool "Cadence TTC timer driver" if COMPILE_TEST
+	depends on COMMON_CLK
+	help
+	  Enables support for the cadence ttc driver.
 
 config ASM9260_TIMER
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 28/69] clocksource/drivers/asm9260: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index badef72..a658190 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -101,9 +101,11 @@ config CADENCE_TTC_TIMER
 	  Enables support for the cadence ttc driver.
 
 config ASM9260_TIMER
-	bool
+	bool "ASM9260 timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
 	select CLKSRC_OF
+	help
+	  Enables support for the ASM9260 timer.
 
 config CLKSRC_NOMADIK_MTU
 	bool
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 28/69] clocksource/drivers/asm9260: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index badef72..a658190 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -101,9 +101,11 @@ config CADENCE_TTC_TIMER
 	  Enables support for the cadence ttc driver.
 
 config ASM9260_TIMER
-	bool
+	bool "ASM9260 timer driver" if COMPILE_TEST
 	select CLKSRC_MMIO
 	select CLKSRC_OF
+	help
+	  Enables support for the ASM9260 timer.
 
 config CLKSRC_NOMADIK_MTU
 	bool
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 29/69] clocksource/drivers/lpc32xx: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index a658190..ed7a824 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -146,9 +146,11 @@ config CLKSRC_EFM32
 	  event device.
 
 config CLKSRC_LPC32XX
-	bool
+	bool "Clocksource for LPC32XX" if COMPILE_TEST
 	select CLKSRC_MMIO
 	select CLKSRC_OF
+	help
+	  Support for the LPC32XX clocksource.
 
 config CLKSRC_PISTACHIO
 	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 29/69] clocksource/drivers/lpc32xx: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index a658190..ed7a824 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -146,9 +146,11 @@ config CLKSRC_EFM32
 	  event device.
 
 config CLKSRC_LPC32XX
-	bool
+	bool "Clocksource for LPC32XX" if COMPILE_TEST
 	select CLKSRC_MMIO
 	select CLKSRC_OF
+	help
+	  Support for the LPC32XX clocksource.
 
 config CLKSRC_PISTACHIO
 	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 30/69] clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable code for the delay timer, this option is only
available for the ARM architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index ed7a824..847b3b1 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -108,8 +108,8 @@ config ASM9260_TIMER
 	  Enables support for the ASM9260 timer.
 
 config CLKSRC_NOMADIK_MTU
-	bool
-	depends on (ARCH_NOMADIK || ARCH_U8500)
+	bool "Nomakdik clocksource driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_MMIO
 	help
 	  Support for Multi Timer Unit. MTU provides access
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 30/69] clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the non portable code for the delay timer, this option is only
available for the ARM architecture.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index ed7a824..847b3b1 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -108,8 +108,8 @@ config ASM9260_TIMER
 	  Enables support for the ASM9260 timer.
 
 config CLKSRC_NOMADIK_MTU
-	bool
-	depends on (ARCH_NOMADIK || ARCH_U8500)
+	bool "Nomakdik clocksource driver" if COMPILE_TEST
+	depends on ARM
 	select CLKSRC_MMIO
 	help
 	  Support for Multi Timer Unit. MTU provides access
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 31/69] clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Linus Walleij, Russell King

Let the platform's Kconfig to select the clock instead of having a reverse
dependency from the driver to the platform options.

Add the COMPILE_TEST option for the compilation test coverage.

This change is debatable as the option itself in the Kconfig allows to
select the driver for the platform or not. This change will make the prcmu
timer always selected.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ux500/Kconfig | 1 +
 drivers/clocksource/Kconfig | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index c9ac19b..5eacdd6 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -32,6 +32,7 @@ config UX500_SOC_DB8500
 	select PINCTRL_AB8540
 	select REGULATOR
 	select REGULATOR_DB8500_PRCMU
+	select CLKSRC_DBX500_PRCMU
 	select PM_GENERIC_DOMAINS if PM
 
 config MACH_MOP500
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 847b3b1..e3ba5b4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -123,9 +123,7 @@ config CLKSRC_NOMADIK_MTU_SCHED_CLOCK
 	  Use the Multi Timer Unit as the sched_clock.
 
 config CLKSRC_DBX500_PRCMU
-	bool "Clocksource PRCMU Timer"
-	depends on UX500_SOC_DB8500
-	default y
+	bool "Clocksource PRCMU Timer" if COMPILE_TEST
 	help
 	  Use the always on PRCMU Timer as clocksource
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 31/69] clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Let the platform's Kconfig to select the clock instead of having a reverse
dependency from the driver to the platform options.

Add the COMPILE_TEST option for the compilation test coverage.

This change is debatable as the option itself in the Kconfig allows to
select the driver for the platform or not. This change will make the prcmu
timer always selected.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ux500/Kconfig | 1 +
 drivers/clocksource/Kconfig | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index c9ac19b..5eacdd6 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -32,6 +32,7 @@ config UX500_SOC_DB8500
 	select PINCTRL_AB8540
 	select REGULATOR
 	select REGULATOR_DB8500_PRCMU
+	select CLKSRC_DBX500_PRCMU
 	select PM_GENERIC_DOMAINS if PM
 
 config MACH_MOP500
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 847b3b1..e3ba5b4 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -123,9 +123,7 @@ config CLKSRC_NOMADIK_MTU_SCHED_CLOCK
 	  Use the Multi Timer Unit as the sched_clock.
 
 config CLKSRC_DBX500_PRCMU
-	bool "Clocksource PRCMU Timer"
-	depends on UX500_SOC_DB8500
-	default y
+	bool "Clocksource PRCMU Timer" if COMPILE_TEST
 	help
 	  Use the always on PRCMU Timer as clocksource
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 32/69] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
  (?)
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Krzysztof Kozlowski,
	Russell King, Kukjin Kim, moderated list:ARM/SAMSUNG EXYNO...

Let the platform's Kconfig to select the clock instead of having a reverse
dependency from the driver to the platform options.

Add the COMPILE_TEST option for the compilation test coverage. Due to the
non portable 'delay' code, this driver is only compilable on ARM.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3a10f1a..ff10539 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select CLKSRC_EXYNOS_MCT
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e3ba5b4..2062783 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -231,8 +231,8 @@ config CLKSRC_METAG_GENERIC
 	  This option enables support for the Meta per-thread timers.
 
 config CLKSRC_EXYNOS_MCT
-	def_bool y if ARCH_EXYNOS
-	depends on !ARM64
+	bool "Exynos multi core timer driver" if COMPILE_TEST
+	depends on ARM
 	help
 	  Support for Multi Core Timer controller on Exynos SoCs.
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 32/69] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Krzysztof Kozlowski,
	Russell King, Kukjin Kim, moderated list:ARM/SAMSUNG EXYNO...

Let the platform's Kconfig to select the clock instead of having a reverse
dependency from the driver to the platform options.

Add the COMPILE_TEST option for the compilation test coverage. Due to the
non portable 'delay' code, this driver is only compilable on ARM.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3a10f1a..ff10539 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select CLKSRC_EXYNOS_MCT
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e3ba5b4..2062783 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -231,8 +231,8 @@ config CLKSRC_METAG_GENERIC
 	  This option enables support for the Meta per-thread timers.
 
 config CLKSRC_EXYNOS_MCT
-	def_bool y if ARCH_EXYNOS
-	depends on !ARM64
+	bool "Exynos multi core timer driver" if COMPILE_TEST
+	depends on ARM
 	help
 	  Support for Multi Core Timer controller on Exynos SoCs.
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 32/69] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Let the platform's Kconfig to select the clock instead of having a reverse
dependency from the driver to the platform options.

Add the COMPILE_TEST option for the compilation test coverage. Due to the
non portable 'delay' code, this driver is only compilable on ARM.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3a10f1a..ff10539 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select CLKSRC_EXYNOS_MCT
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e3ba5b4..2062783 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -231,8 +231,8 @@ config CLKSRC_METAG_GENERIC
 	  This option enables support for the Meta per-thread timers.
 
 config CLKSRC_EXYNOS_MCT
-	def_bool y if ARCH_EXYNOS
-	depends on !ARM64
+	bool "Exynos multi core timer driver" if COMPILE_TEST
+	depends on ARM
 	help
 	  Support for Multi Core Timer controller on Exynos SoCs.
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 33/69] clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 2062783..3457a86 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -237,7 +237,7 @@ config CLKSRC_EXYNOS_MCT
 	  Support for Multi Core Timer controller on Exynos SoCs.
 
 config CLKSRC_SAMSUNG_PWM
-	bool
+	bool "PWM timer drvier for Samsung S3C, S5P" if COMPILE_TEST
 	help
 	  This is a new clocksource driver for the PWM timer found in
 	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 33/69] clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 2062783..3457a86 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -237,7 +237,7 @@ config CLKSRC_EXYNOS_MCT
 	  Support for Multi Core Timer controller on Exynos SoCs.
 
 config CLKSRC_SAMSUNG_PWM
-	bool
+	bool "PWM timer drvier for Samsung S3C, S5P" if COMPILE_TEST
 	help
 	  This is a new clocksource driver for the PWM timer found in
 	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 34/69] clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3457a86..7085eb7 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -245,7 +245,7 @@ config CLKSRC_SAMSUNG_PWM
 	  needed only on systems that do not have the Exynos MCT available.
 
 config FSL_FTM_TIMER
-	bool
+	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
 	help
 	  Support for Freescale FlexTimer Module (FTM) timer.
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 34/69] clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 3457a86..7085eb7 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -245,7 +245,7 @@ config CLKSRC_SAMSUNG_PWM
 	  needed only on systems that do not have the Exynos MCT available.
 
 config FSL_FTM_TIMER
-	bool
+	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
 	help
 	  Support for Freescale FlexTimer Module (FTM) timer.
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 35/69] clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependency
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

In order to compile on all arch without error with 'allyesconfig' make
sure the platform selected the GENERIC_CLOCKEVENTS. Without this patch
the new added drivers will prevent the kernel to compile on PARISC.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 7085eb7..de331b8 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -29,11 +29,13 @@ config CLKSRC_MMIO
 
 config DIGICOLOR_TIMER
 	bool "Digicolor timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
 	bool "DW APB timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables the support for the dw_apb timer.
 
@@ -58,6 +60,7 @@ config ARMADA_370_XP_TIMER
 
 config MESON6_TIMER
 	bool "Meson6 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	help
 	  Enables the support for the Meson6 timer driver.
@@ -72,6 +75,7 @@ config ORION_TIMER
 
 config SUN4I_TIMER
 	bool "Sun4i timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	help
 	  Enables support for the Sun4i timer.
@@ -91,6 +95,7 @@ config TEGRA_TIMER
 
 config VT8500_TIMER
 	bool "VT8500 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables support for the VT8500 driver.
 
@@ -102,6 +107,7 @@ config CADENCE_TTC_TIMER
 
 config ASM9260_TIMER
 	bool "ASM9260 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	help
@@ -124,6 +130,7 @@ config CLKSRC_NOMADIK_MTU_SCHED_CLOCK
 
 config CLKSRC_DBX500_PRCMU
 	bool "Clocksource PRCMU Timer" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Use the always on PRCMU Timer as clocksource
 
@@ -145,6 +152,7 @@ config CLKSRC_EFM32
 
 config CLKSRC_LPC32XX
 	bool "Clocksource for LPC32XX" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	help
@@ -238,6 +246,7 @@ config CLKSRC_EXYNOS_MCT
 
 config CLKSRC_SAMSUNG_PWM
 	bool "PWM timer drvier for Samsung S3C, S5P" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  This is a new clocksource driver for the PWM timer found in
 	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
@@ -246,6 +255,7 @@ config CLKSRC_SAMSUNG_PWM
 
 config FSL_FTM_TIMER
 	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Support for Freescale FlexTimer Module (FTM) timer.
 
@@ -259,6 +269,7 @@ config SYS_SUPPORTS_SH_CMT
 
 config MTK_TIMER
 	bool "Mediatek timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_OF
 	select CLKSRC_MMIO
 	help
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 35/69] clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependency
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

In order to compile on all arch without error with 'allyesconfig' make
sure the platform selected the GENERIC_CLOCKEVENTS. Without this patch
the new added drivers will prevent the kernel to compile on PARISC.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 7085eb7..de331b8 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -29,11 +29,13 @@ config CLKSRC_MMIO
 
 config DIGICOLOR_TIMER
 	bool "Digicolor timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables the support for the digicolor timer driver.
 
 config DW_APB_TIMER
 	bool "DW APB timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables the support for the dw_apb timer.
 
@@ -58,6 +60,7 @@ config ARMADA_370_XP_TIMER
 
 config MESON6_TIMER
 	bool "Meson6 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	help
 	  Enables the support for the Meson6 timer driver.
@@ -72,6 +75,7 @@ config ORION_TIMER
 
 config SUN4I_TIMER
 	bool "Sun4i timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	help
 	  Enables support for the Sun4i timer.
@@ -91,6 +95,7 @@ config TEGRA_TIMER
 
 config VT8500_TIMER
 	bool "VT8500 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Enables support for the VT8500 driver.
 
@@ -102,6 +107,7 @@ config CADENCE_TTC_TIMER
 
 config ASM9260_TIMER
 	bool "ASM9260 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	help
@@ -124,6 +130,7 @@ config CLKSRC_NOMADIK_MTU_SCHED_CLOCK
 
 config CLKSRC_DBX500_PRCMU
 	bool "Clocksource PRCMU Timer" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Use the always on PRCMU Timer as clocksource
 
@@ -145,6 +152,7 @@ config CLKSRC_EFM32
 
 config CLKSRC_LPC32XX
 	bool "Clocksource for LPC32XX" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	help
@@ -238,6 +246,7 @@ config CLKSRC_EXYNOS_MCT
 
 config CLKSRC_SAMSUNG_PWM
 	bool "PWM timer drvier for Samsung S3C, S5P" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  This is a new clocksource driver for the PWM timer found in
 	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
@@ -246,6 +255,7 @@ config CLKSRC_SAMSUNG_PWM
 
 config FSL_FTM_TIMER
 	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	help
 	  Support for Freescale FlexTimer Module (FTM) timer.
 
@@ -259,6 +269,7 @@ config SYS_SUPPORTS_SH_CMT
 
 config MTK_TIMER
 	bool "Mediatek timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
 	select CLKSRC_OF
 	select CLKSRC_MMIO
 	help
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 36/69] clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang

From: Jisheng Zhang <jszhang@marvell.com>

Implement an ARM delay timer to be used for udelay(). This allows us to
skip the delay loop calibration at boot on Marvell BG2, BG2Q, BG2CD
platforms. And after this patch, udelay() will be unaffected by CPU
frequency changes.

Note: Although in case there are several possible delay timers, we may
not select the "best" delay timer. Take one Marvell Berlin platform for
example: we have arch timer and dw-apb timer. The arch timer freq is
25MHZ while the dw-apb timer freq is 100MHZ, current selection would
choose the dw-apb timer. But the dw apb timer is on the APB bus while
arch timer sits in CPU, the cost of accessing the apb timer is higher
than the arch timer. We could introduce "rating" concept to delay
timer, but this approach "brings a lot of complexity and workarounds
in the code for a small benefit" as pointed out by Daniel.

Later, Arnd pointed out "However, we could argue that this actually
doesn't matter at all, because the entire point of the ndelay()/
udelay()/mdelay() functions is to waste CPU cycles doing not much at
all, so we can just as well waste them reading the timer register
than spinning on the CPU reading the arch timer more often.", so we
just simply register the dw apb base delay timer.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer_of.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index a19a3f6..860843c 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -16,6 +16,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#include <linux/delay.h>
 #include <linux/dw_apb_timer.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -130,6 +131,17 @@ static void __init init_sched_clock(void)
 	sched_clock_register(read_sched_clock, 32, sched_rate);
 }
 
+#ifdef CONFIG_ARM
+static unsigned long dw_apb_delay_timer_read(void)
+{
+	return ~readl_relaxed(sched_io_base);
+}
+
+static struct delay_timer dw_apb_delay_timer = {
+	.read_current_timer	= dw_apb_delay_timer_read,
+};
+#endif
+
 static int num_called;
 static void __init dw_apb_timer_init(struct device_node *timer)
 {
@@ -142,6 +154,10 @@ static void __init dw_apb_timer_init(struct device_node *timer)
 		pr_debug("%s: found clocksource timer\n", __func__);
 		add_clocksource(timer);
 		init_sched_clock();
+#ifdef CONFIG_ARM
+		dw_apb_delay_timer.freq = sched_rate;
+		register_current_timer_delay(&dw_apb_delay_timer);
+#endif
 		break;
 	default:
 		break;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 36/69] clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

Implement an ARM delay timer to be used for udelay(). This allows us to
skip the delay loop calibration at boot on Marvell BG2, BG2Q, BG2CD
platforms. And after this patch, udelay() will be unaffected by CPU
frequency changes.

Note: Although in case there are several possible delay timers, we may
not select the "best" delay timer. Take one Marvell Berlin platform for
example: we have arch timer and dw-apb timer. The arch timer freq is
25MHZ while the dw-apb timer freq is 100MHZ, current selection would
choose the dw-apb timer. But the dw apb timer is on the APB bus while
arch timer sits in CPU, the cost of accessing the apb timer is higher
than the arch timer. We could introduce "rating" concept to delay
timer, but this approach "brings a lot of complexity and workarounds
in the code for a small benefit" as pointed out by Daniel.

Later, Arnd pointed out "However, we could argue that this actually
doesn't matter at all, because the entire point of the ndelay()/
udelay()/mdelay() functions is to waste CPU cycles doing not much at
all, so we can just as well waste them reading the timer register
than spinning on the CPU reading the arch timer more often.", so we
just simply register the dw apb base delay timer.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer_of.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index a19a3f6..860843c 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -16,6 +16,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#include <linux/delay.h>
 #include <linux/dw_apb_timer.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -130,6 +131,17 @@ static void __init init_sched_clock(void)
 	sched_clock_register(read_sched_clock, 32, sched_rate);
 }
 
+#ifdef CONFIG_ARM
+static unsigned long dw_apb_delay_timer_read(void)
+{
+	return ~readl_relaxed(sched_io_base);
+}
+
+static struct delay_timer dw_apb_delay_timer = {
+	.read_current_timer	= dw_apb_delay_timer_read,
+};
+#endif
+
 static int num_called;
 static void __init dw_apb_timer_init(struct device_node *timer)
 {
@@ -142,6 +154,10 @@ static void __init dw_apb_timer_init(struct device_node *timer)
 		pr_debug("%s: found clocksource timer\n", __func__);
 		add_clocksource(timer);
 		init_sched_clock();
+#ifdef CONFIG_ARM
+		dw_apb_delay_timer.freq = sched_rate;
+		register_current_timer_delay(&dw_apb_delay_timer);
+#endif
 		break;
 	default:
 		break;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 37/69] clocksource/drivers/h8300: Cleanup startup and remove module code.
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Remove some legacy code and replace it by the clksrc-of code.

Do some cleanup and code consolidation.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 141 +++++++++++++--------------------
 drivers/clocksource/h8300_timer8.c  | 150 ++++++++++++------------------------
 drivers/clocksource/h8300_tpu.c     | 117 ++++++++++------------------
 3 files changed, 144 insertions(+), 264 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 0e076c6..cdf0d83 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -17,6 +17,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/segment.h>
 #include <asm/irq.h>
@@ -47,9 +49,7 @@
 #define ABSOLUTE 1
 
 struct timer16_priv {
-	struct platform_device *pdev;
 	struct clocksource cs;
-	struct irqaction irqaction;
 	unsigned long total_cycles;
 	unsigned long mapbase;
 	unsigned long mapcommon;
@@ -144,110 +144,77 @@ static void timer16_disable(struct clocksource *cs)
 	p->cs_enabled = false;
 }
 
+static struct timer16_priv timer16_priv = {
+	.cs = {
+		.name = "h8300_16timer",
+		.rating = 200,
+		.read = timer16_clocksource_read,
+		.enable = timer16_enable,
+		.disable = timer16_disable,
+		.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+		.flags = CLOCK_SOURCE_IS_CONTINUOUS,
+	},
+};
+
 #define REG_CH   0
 #define REG_COMM 1
 
-static int timer16_setup(struct timer16_priv *p, struct platform_device *pdev)
+static void __init h8300_16timer_init(struct device_node *node)
 {
-	struct resource *res[2];
+	void __iomem *base[2];
 	int ret, irq;
 	unsigned int ch;
+	struct clk *clk;
 
-	p->pdev = pdev;
-
-	res[REG_CH] = platform_get_resource(p->pdev,
-					    IORESOURCE_MEM, REG_CH);
-	res[REG_COMM] = platform_get_resource(p->pdev,
-					      IORESOURCE_MEM, REG_COMM);
-	if (!res[REG_CH] || !res[REG_COMM]) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
-	}
-	irq = platform_get_irq(p->pdev, 0);
-	if (irq < 0) {
-		dev_err(&p->pdev->dev, "failed to get irq\n");
-		return irq;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clocksource\n");
+		return;
 	}
 
-	p->clk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->clk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->clk);
+	base[REG_CH] = of_iomap(node, 0);
+	if (!base[REG_CH]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto free_clk;
 	}
-	of_property_read_u32(p->pdev->dev.of_node, "renesas,channel", &ch);
-
-	p->pdev = pdev;
-	p->mapbase = res[REG_CH]->start;
-	p->mapcommon = res[REG_COMM]->start;
-	p->enb = 1 << ch;
-	p->imfa = 1 << ch;
-	p->imiea = 1 << (4 + ch);
-	p->cs.name = pdev->name;
-	p->cs.rating = 200;
-	p->cs.read = timer16_clocksource_read;
-	p->cs.enable = timer16_enable;
-	p->cs.disable = timer16_disable;
-	p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
-	p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
 
-	ret = request_irq(irq, timer16_interrupt,
-			  IRQF_TIMER, pdev->name, p);
-	if (ret < 0) {
-		dev_err(&p->pdev->dev, "failed to request irq %d\n", irq);
-		return ret;
+	base[REG_COMM] = of_iomap(node, 1);
+	if (!base[REG_COMM]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto unmap_ch;
 	}
 
-	clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 8);
-
-	return 0;
-}
-
-static int timer16_probe(struct platform_device *pdev)
-{
-	struct timer16_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
+	irq = irq_of_parse_and_map(node, 0);
+	if (irq < 0) {
+		pr_err("failed to get irq for clockevent\n");
+		goto unmap_comm;
 	}
 
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
+	of_property_read_u32(node, "renesas,channel", &ch);
 
-	return timer16_setup(p, pdev);
-}
+	timer16_priv.mapbase = (unsigned long)base[REG_CH];
+	timer16_priv.mapcommon = (unsigned long)base[REG_COMM];
+	timer16_priv.enb = 1 << ch;
+	timer16_priv.imfa = 1 << ch;
+	timer16_priv.imiea = 1 << (4 + ch);
 
-static int timer16_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
-
-static const struct of_device_id timer16_of_table[] = {
-	{ .compatible = "renesas,16bit-timer" },
-	{ }
-};
-static struct platform_driver timer16_driver = {
-	.probe		= timer16_probe,
-	.remove		= timer16_remove,
-	.driver		= {
-		.name	= "h8300h-16timer",
-		.of_match_table = of_match_ptr(timer16_of_table),
+	ret = request_irq(irq, timer16_interrupt,
+			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
+	if (ret < 0) {
+		pr_err("failed to request irq %d of clocksource\n", irq);
+		goto unmap_comm;
 	}
-};
 
-static int __init timer16_init(void)
-{
-	return platform_driver_register(&timer16_driver);
-}
+	clocksource_register_hz(&timer16_priv.cs,
+				clk_get_rate(timer16_priv.clk) / 8);
+	return;
 
-static void __exit timer16_exit(void)
-{
-	platform_driver_unregister(&timer16_driver);
+unmap_comm:
+	iounmap(base[REG_COMM]);
+unmap_ch:
+	iounmap(base[REG_CH]);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(timer16_init);
-module_exit(timer16_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300H 16bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_16bit, "renesas,16bit-timer", h8300_16timer_init);
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 44375d8..f0680eb 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -12,13 +12,14 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/clockchips.h>
 #include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/irq.h>
 
@@ -39,10 +40,10 @@
 #define RELATIVE 0
 #define ABSOLUTE 1
 
+#define SCALE 64
+
 struct timer8_priv {
-	struct platform_device *pdev;
 	struct clock_event_device ced;
-	struct irqaction irqaction;
 	unsigned long mapbase;
 	raw_spinlock_t lock;
 	unsigned long flags;
@@ -111,7 +112,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	p->rate = clk_get_rate(p->pclk) / 64;
+	p->rate = clk_get_rate(p->pclk) / SCALE;
 	ctrl_outw(0xffff, p->mapbase + TCORA);
 	ctrl_outw(0x0000, p->mapbase + _8TCNT);
 	ctrl_outw(0x0c02, p->mapbase + _8TCR);
@@ -179,7 +180,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
 {
 	struct timer8_priv *p = ced_to_priv(ced);
 
-	dev_info(&p->pdev->dev, "used for periodic clock events\n");
+	pr_info("%s: used for periodic clock events\n", ced->name);
 	timer8_stop(p);
 	timer8_clock_event_start(p, PERIODIC);
 
@@ -190,7 +191,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
 {
 	struct timer8_priv *p = ced_to_priv(ced);
 
-	dev_info(&p->pdev->dev, "used for oneshot clock events\n");
+	pr_info("%s: used for oneshot clock events\n", ced->name);
 	timer8_stop(p);
 	timer8_clock_event_start(p, ONESHOT);
 
@@ -208,110 +209,61 @@ static int timer8_clock_event_next(unsigned long delta,
 	return 0;
 }
 
-static int timer8_setup(struct timer8_priv *p,
-			struct platform_device *pdev)
+static struct timer8_priv timer8_priv = {
+	.ced = {
+		.name = "h8300_8timer",
+		.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+		.rating = 200,
+		.set_next_event = timer8_clock_event_next,
+		.set_state_shutdown = timer8_clock_event_shutdown,
+		.set_state_periodic = timer8_clock_event_periodic,
+		.set_state_oneshot = timer8_clock_event_oneshot,
+	},
+};
+
+static void __init h8300_8timer_init(struct device_node *node)
 {
-	struct resource *res;
+	void __iomem *base;
 	int irq;
-	int ret;
+	int ret = 0;
+	int rate;
+	struct clk *clk;
 
-	p->pdev = pdev;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clockevent\n");
+		return;
+	}
 
-	res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
+	base = of_iomap(node, 0);
+	if (!base) {
+		pr_err("failed to map registers for clockevent\n");
+		goto free_clk;
 	}
 
-	irq = platform_get_irq(p->pdev, 0);
+	irq = irq_of_parse_and_map(node, 0);
 	if (irq < 0) {
-		dev_err(&p->pdev->dev, "failed to get irq\n");
-		return -ENXIO;
+		pr_err("failed to get irq for clockevent\n");
+		goto unmap_reg;
 	}
 
-	p->mapbase = res->start;
-
-	p->irqaction.name = dev_name(&p->pdev->dev);
-	p->irqaction.handler = timer8_interrupt;
-	p->irqaction.dev_id = p;
-	p->irqaction.flags = IRQF_TIMER;
-
-	p->pclk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->pclk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->pclk);
-	}
+	timer8_priv.mapbase = (unsigned long)base;
+	timer8_priv.pclk = clk;
 
-	p->ced.name = pdev->name;
-	p->ced.features = CLOCK_EVT_FEAT_PERIODIC |
-		CLOCK_EVT_FEAT_ONESHOT;
-	p->ced.rating = 200;
-	p->ced.cpumask = cpumask_of(0);
-	p->ced.set_next_event = timer8_clock_event_next;
-	p->ced.set_state_shutdown = timer8_clock_event_shutdown;
-	p->ced.set_state_periodic = timer8_clock_event_periodic;
-	p->ced.set_state_oneshot = timer8_clock_event_oneshot;
-
-	ret = setup_irq(irq, &p->irqaction);
+	ret = request_irq(irq, timer8_interrupt,
+			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
 	if (ret < 0) {
-		dev_err(&p->pdev->dev,
-			"failed to request irq %d\n", irq);
-		return ret;
+		pr_err("failed to request irq %d for clockevent\n", irq);
+		goto unmap_reg;
 	}
-	clockevents_register_device(&p->ced);
-	platform_set_drvdata(pdev, p);
-
-	return 0;
-}
-
-static int timer8_probe(struct platform_device *pdev)
-{
-	struct timer8_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
-	}
-
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
-
-	return timer8_setup(p, pdev);
-}
-
-static int timer8_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
-
-static const struct of_device_id timer8_of_table[] __maybe_unused = {
-	{ .compatible = "renesas,8bit-timer" },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(of, timer8_of_table);
-static struct platform_driver timer8_driver = {
-	.probe		= timer8_probe,
-	.remove		= timer8_remove,
-	.driver		= {
-		.name	= "h8300-8timer",
-		.of_match_table = of_match_ptr(timer8_of_table),
-	}
-};
-
-static int __init timer8_init(void)
-{
-	return platform_driver_register(&timer8_driver);
-}
-
-static void __exit timer8_exit(void)
-{
-	platform_driver_unregister(&timer8_driver);
+	rate = clk_get_rate(clk) / SCALE;
+	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
+	return;
+
+unmap_reg:
+	iounmap(base);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(timer8_init);
-module_exit(timer8_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300 8bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_8bit, "renesas,8bit-timer", h8300_8timer_init);
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 5487410..ed0b493 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -1,5 +1,5 @@
 /*
- *  H8/300 TPU Driver
+ *  H8S TPU Driver
  *
  *  Copyright 2015 Yoshinori Sato <ysato@users.sourcefoge.jp>
  *
@@ -17,8 +17,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
-
-#include <asm/irq.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #define TCR	0
 #define TMDR	1
@@ -32,9 +32,7 @@
 #define TGRD	14
 
 struct tpu_priv {
-	struct platform_device *pdev;
 	struct clocksource cs;
-	struct clk *clk;
 	unsigned long mapbase1;
 	unsigned long mapbase2;
 	raw_spinlock_t lock;
@@ -116,91 +114,54 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 	p->cs_enabled = false;
 }
 
+static struct tpu_priv tpu_priv = {
+	.cs = {
+		.name = "H8S_TPU",
+		.rating = 200,
+		.read = tpu_clocksource_read,
+		.enable = tpu_clocksource_enable,
+		.disable = tpu_clocksource_disable,
+		.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+		.flags = CLOCK_SOURCE_IS_CONTINUOUS,
+	},
+};
+
 #define CH_L 0
 #define CH_H 1
 
-static int __init tpu_setup(struct tpu_priv *p, struct platform_device *pdev)
+static void __init h8300_tpu_init(struct device_node *node)
 {
-	struct resource *res[2];
-
-	p->pdev = pdev;
+	void __iomem *base[2];
+	struct clk *clk;
 
-	res[CH_L] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_L);
-	res[CH_H] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_H);
-	if (!res[CH_L] || !res[CH_H]) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clocksource\n");
+		return;
 	}
 
-	p->clk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->clk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->clk);
+	base[CH_L] = of_iomap(node, CH_L);
+	if (!base[CH_L]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto free_clk;
 	}
-
-	p->mapbase1 = res[CH_L]->start;
-	p->mapbase2 = res[CH_H]->start;
-
-	p->cs.name = pdev->name;
-	p->cs.rating = 200;
-	p->cs.read = tpu_clocksource_read;
-	p->cs.enable = tpu_clocksource_enable;
-	p->cs.disable = tpu_clocksource_disable;
-	p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
-	p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
-	clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 64);
-	platform_set_drvdata(pdev, p);
-
-	return 0;
-}
-
-static int tpu_probe(struct platform_device *pdev)
-{
-	struct tpu_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
+	base[CH_H] = of_iomap(node, CH_H);
+	if (!base[CH_H]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto unmap_L;
 	}
 
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
+	tpu_priv.mapbase1 = (unsigned long)base[CH_L];
+	tpu_priv.mapbase2 = (unsigned long)base[CH_H];
 
-	return tpu_setup(p, pdev);
-}
+	clocksource_register_hz(&tpu_priv.cs, clk_get_rate(clk) / 64);
 
-static int tpu_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
+	return;
 
-static const struct of_device_id tpu_of_table[] = {
-	{ .compatible = "renesas,tpu" },
-	{ }
-};
-
-static struct platform_driver tpu_driver = {
-	.probe		= tpu_probe,
-	.remove		= tpu_remove,
-	.driver		= {
-		.name	= "h8s-tpu",
-		.of_match_table = of_match_ptr(tpu_of_table),
-	}
-};
-
-static int __init tpu_init(void)
-{
-	return platform_driver_register(&tpu_driver);
-}
-
-static void __exit tpu_exit(void)
-{
-	platform_driver_unregister(&tpu_driver);
+unmap_L:
+	iounmap(base[CH_H]);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(tpu_init);
-module_exit(tpu_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8S Timer Pulse Unit Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_tpu, "renesas,tpu", h8300_tpu_init);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 37/69] clocksource/drivers/h8300: Cleanup startup and remove module code.
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Remove some legacy code and replace it by the clksrc-of code.

Do some cleanup and code consolidation.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 141 +++++++++++++--------------------
 drivers/clocksource/h8300_timer8.c  | 150 ++++++++++++------------------------
 drivers/clocksource/h8300_tpu.c     | 117 ++++++++++------------------
 3 files changed, 144 insertions(+), 264 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 0e076c6..cdf0d83 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -17,6 +17,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/segment.h>
 #include <asm/irq.h>
@@ -47,9 +49,7 @@
 #define ABSOLUTE 1
 
 struct timer16_priv {
-	struct platform_device *pdev;
 	struct clocksource cs;
-	struct irqaction irqaction;
 	unsigned long total_cycles;
 	unsigned long mapbase;
 	unsigned long mapcommon;
@@ -144,110 +144,77 @@ static void timer16_disable(struct clocksource *cs)
 	p->cs_enabled = false;
 }
 
+static struct timer16_priv timer16_priv = {
+	.cs = {
+		.name = "h8300_16timer",
+		.rating = 200,
+		.read = timer16_clocksource_read,
+		.enable = timer16_enable,
+		.disable = timer16_disable,
+		.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+		.flags = CLOCK_SOURCE_IS_CONTINUOUS,
+	},
+};
+
 #define REG_CH   0
 #define REG_COMM 1
 
-static int timer16_setup(struct timer16_priv *p, struct platform_device *pdev)
+static void __init h8300_16timer_init(struct device_node *node)
 {
-	struct resource *res[2];
+	void __iomem *base[2];
 	int ret, irq;
 	unsigned int ch;
+	struct clk *clk;
 
-	p->pdev = pdev;
-
-	res[REG_CH] = platform_get_resource(p->pdev,
-					    IORESOURCE_MEM, REG_CH);
-	res[REG_COMM] = platform_get_resource(p->pdev,
-					      IORESOURCE_MEM, REG_COMM);
-	if (!res[REG_CH] || !res[REG_COMM]) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
-	}
-	irq = platform_get_irq(p->pdev, 0);
-	if (irq < 0) {
-		dev_err(&p->pdev->dev, "failed to get irq\n");
-		return irq;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clocksource\n");
+		return;
 	}
 
-	p->clk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->clk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->clk);
+	base[REG_CH] = of_iomap(node, 0);
+	if (!base[REG_CH]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto free_clk;
 	}
-	of_property_read_u32(p->pdev->dev.of_node, "renesas,channel", &ch);
-
-	p->pdev = pdev;
-	p->mapbase = res[REG_CH]->start;
-	p->mapcommon = res[REG_COMM]->start;
-	p->enb = 1 << ch;
-	p->imfa = 1 << ch;
-	p->imiea = 1 << (4 + ch);
-	p->cs.name = pdev->name;
-	p->cs.rating = 200;
-	p->cs.read = timer16_clocksource_read;
-	p->cs.enable = timer16_enable;
-	p->cs.disable = timer16_disable;
-	p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
-	p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
 
-	ret = request_irq(irq, timer16_interrupt,
-			  IRQF_TIMER, pdev->name, p);
-	if (ret < 0) {
-		dev_err(&p->pdev->dev, "failed to request irq %d\n", irq);
-		return ret;
+	base[REG_COMM] = of_iomap(node, 1);
+	if (!base[REG_COMM]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto unmap_ch;
 	}
 
-	clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 8);
-
-	return 0;
-}
-
-static int timer16_probe(struct platform_device *pdev)
-{
-	struct timer16_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
+	irq = irq_of_parse_and_map(node, 0);
+	if (irq < 0) {
+		pr_err("failed to get irq for clockevent\n");
+		goto unmap_comm;
 	}
 
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
+	of_property_read_u32(node, "renesas,channel", &ch);
 
-	return timer16_setup(p, pdev);
-}
+	timer16_priv.mapbase = (unsigned long)base[REG_CH];
+	timer16_priv.mapcommon = (unsigned long)base[REG_COMM];
+	timer16_priv.enb = 1 << ch;
+	timer16_priv.imfa = 1 << ch;
+	timer16_priv.imiea = 1 << (4 + ch);
 
-static int timer16_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
-
-static const struct of_device_id timer16_of_table[] = {
-	{ .compatible = "renesas,16bit-timer" },
-	{ }
-};
-static struct platform_driver timer16_driver = {
-	.probe		= timer16_probe,
-	.remove		= timer16_remove,
-	.driver		= {
-		.name	= "h8300h-16timer",
-		.of_match_table = of_match_ptr(timer16_of_table),
+	ret = request_irq(irq, timer16_interrupt,
+			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
+	if (ret < 0) {
+		pr_err("failed to request irq %d of clocksource\n", irq);
+		goto unmap_comm;
 	}
-};
 
-static int __init timer16_init(void)
-{
-	return platform_driver_register(&timer16_driver);
-}
+	clocksource_register_hz(&timer16_priv.cs,
+				clk_get_rate(timer16_priv.clk) / 8);
+	return;
 
-static void __exit timer16_exit(void)
-{
-	platform_driver_unregister(&timer16_driver);
+unmap_comm:
+	iounmap(base[REG_COMM]);
+unmap_ch:
+	iounmap(base[REG_CH]);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(timer16_init);
-module_exit(timer16_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300H 16bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_16bit, "renesas,16bit-timer", h8300_16timer_init);
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 44375d8..f0680eb 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -12,13 +12,14 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/clockchips.h>
 #include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/irq.h>
 
@@ -39,10 +40,10 @@
 #define RELATIVE 0
 #define ABSOLUTE 1
 
+#define SCALE 64
+
 struct timer8_priv {
-	struct platform_device *pdev;
 	struct clock_event_device ced;
-	struct irqaction irqaction;
 	unsigned long mapbase;
 	raw_spinlock_t lock;
 	unsigned long flags;
@@ -111,7 +112,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	p->rate = clk_get_rate(p->pclk) / 64;
+	p->rate = clk_get_rate(p->pclk) / SCALE;
 	ctrl_outw(0xffff, p->mapbase + TCORA);
 	ctrl_outw(0x0000, p->mapbase + _8TCNT);
 	ctrl_outw(0x0c02, p->mapbase + _8TCR);
@@ -179,7 +180,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
 {
 	struct timer8_priv *p = ced_to_priv(ced);
 
-	dev_info(&p->pdev->dev, "used for periodic clock events\n");
+	pr_info("%s: used for periodic clock events\n", ced->name);
 	timer8_stop(p);
 	timer8_clock_event_start(p, PERIODIC);
 
@@ -190,7 +191,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
 {
 	struct timer8_priv *p = ced_to_priv(ced);
 
-	dev_info(&p->pdev->dev, "used for oneshot clock events\n");
+	pr_info("%s: used for oneshot clock events\n", ced->name);
 	timer8_stop(p);
 	timer8_clock_event_start(p, ONESHOT);
 
@@ -208,110 +209,61 @@ static int timer8_clock_event_next(unsigned long delta,
 	return 0;
 }
 
-static int timer8_setup(struct timer8_priv *p,
-			struct platform_device *pdev)
+static struct timer8_priv timer8_priv = {
+	.ced = {
+		.name = "h8300_8timer",
+		.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+		.rating = 200,
+		.set_next_event = timer8_clock_event_next,
+		.set_state_shutdown = timer8_clock_event_shutdown,
+		.set_state_periodic = timer8_clock_event_periodic,
+		.set_state_oneshot = timer8_clock_event_oneshot,
+	},
+};
+
+static void __init h8300_8timer_init(struct device_node *node)
 {
-	struct resource *res;
+	void __iomem *base;
 	int irq;
-	int ret;
+	int ret = 0;
+	int rate;
+	struct clk *clk;
 
-	p->pdev = pdev;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clockevent\n");
+		return;
+	}
 
-	res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
+	base = of_iomap(node, 0);
+	if (!base) {
+		pr_err("failed to map registers for clockevent\n");
+		goto free_clk;
 	}
 
-	irq = platform_get_irq(p->pdev, 0);
+	irq = irq_of_parse_and_map(node, 0);
 	if (irq < 0) {
-		dev_err(&p->pdev->dev, "failed to get irq\n");
-		return -ENXIO;
+		pr_err("failed to get irq for clockevent\n");
+		goto unmap_reg;
 	}
 
-	p->mapbase = res->start;
-
-	p->irqaction.name = dev_name(&p->pdev->dev);
-	p->irqaction.handler = timer8_interrupt;
-	p->irqaction.dev_id = p;
-	p->irqaction.flags = IRQF_TIMER;
-
-	p->pclk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->pclk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->pclk);
-	}
+	timer8_priv.mapbase = (unsigned long)base;
+	timer8_priv.pclk = clk;
 
-	p->ced.name = pdev->name;
-	p->ced.features = CLOCK_EVT_FEAT_PERIODIC |
-		CLOCK_EVT_FEAT_ONESHOT;
-	p->ced.rating = 200;
-	p->ced.cpumask = cpumask_of(0);
-	p->ced.set_next_event = timer8_clock_event_next;
-	p->ced.set_state_shutdown = timer8_clock_event_shutdown;
-	p->ced.set_state_periodic = timer8_clock_event_periodic;
-	p->ced.set_state_oneshot = timer8_clock_event_oneshot;
-
-	ret = setup_irq(irq, &p->irqaction);
+	ret = request_irq(irq, timer8_interrupt,
+			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
 	if (ret < 0) {
-		dev_err(&p->pdev->dev,
-			"failed to request irq %d\n", irq);
-		return ret;
+		pr_err("failed to request irq %d for clockevent\n", irq);
+		goto unmap_reg;
 	}
-	clockevents_register_device(&p->ced);
-	platform_set_drvdata(pdev, p);
-
-	return 0;
-}
-
-static int timer8_probe(struct platform_device *pdev)
-{
-	struct timer8_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
-	}
-
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
-
-	return timer8_setup(p, pdev);
-}
-
-static int timer8_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
-
-static const struct of_device_id timer8_of_table[] __maybe_unused = {
-	{ .compatible = "renesas,8bit-timer" },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(of, timer8_of_table);
-static struct platform_driver timer8_driver = {
-	.probe		= timer8_probe,
-	.remove		= timer8_remove,
-	.driver		= {
-		.name	= "h8300-8timer",
-		.of_match_table = of_match_ptr(timer8_of_table),
-	}
-};
-
-static int __init timer8_init(void)
-{
-	return platform_driver_register(&timer8_driver);
-}
-
-static void __exit timer8_exit(void)
-{
-	platform_driver_unregister(&timer8_driver);
+	rate = clk_get_rate(clk) / SCALE;
+	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
+	return;
+
+unmap_reg:
+	iounmap(base);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(timer8_init);
-module_exit(timer8_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300 8bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_8bit, "renesas,8bit-timer", h8300_8timer_init);
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 5487410..ed0b493 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -1,5 +1,5 @@
 /*
- *  H8/300 TPU Driver
+ *  H8S TPU Driver
  *
  *  Copyright 2015 Yoshinori Sato <ysato@users.sourcefoge.jp>
  *
@@ -17,8 +17,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
-
-#include <asm/irq.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #define TCR	0
 #define TMDR	1
@@ -32,9 +32,7 @@
 #define TGRD	14
 
 struct tpu_priv {
-	struct platform_device *pdev;
 	struct clocksource cs;
-	struct clk *clk;
 	unsigned long mapbase1;
 	unsigned long mapbase2;
 	raw_spinlock_t lock;
@@ -116,91 +114,54 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 	p->cs_enabled = false;
 }
 
+static struct tpu_priv tpu_priv = {
+	.cs = {
+		.name = "H8S_TPU",
+		.rating = 200,
+		.read = tpu_clocksource_read,
+		.enable = tpu_clocksource_enable,
+		.disable = tpu_clocksource_disable,
+		.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+		.flags = CLOCK_SOURCE_IS_CONTINUOUS,
+	},
+};
+
 #define CH_L 0
 #define CH_H 1
 
-static int __init tpu_setup(struct tpu_priv *p, struct platform_device *pdev)
+static void __init h8300_tpu_init(struct device_node *node)
 {
-	struct resource *res[2];
-
-	p->pdev = pdev;
+	void __iomem *base[2];
+	struct clk *clk;
 
-	res[CH_L] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_L);
-	res[CH_H] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_H);
-	if (!res[CH_L] || !res[CH_H]) {
-		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
-		return -ENXIO;
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		pr_err("failed to get clock for clocksource\n");
+		return;
 	}
 
-	p->clk = clk_get(&p->pdev->dev, "fck");
-	if (IS_ERR(p->clk)) {
-		dev_err(&p->pdev->dev, "can't get clk\n");
-		return PTR_ERR(p->clk);
+	base[CH_L] = of_iomap(node, CH_L);
+	if (!base[CH_L]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto free_clk;
 	}
-
-	p->mapbase1 = res[CH_L]->start;
-	p->mapbase2 = res[CH_H]->start;
-
-	p->cs.name = pdev->name;
-	p->cs.rating = 200;
-	p->cs.read = tpu_clocksource_read;
-	p->cs.enable = tpu_clocksource_enable;
-	p->cs.disable = tpu_clocksource_disable;
-	p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
-	p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
-	clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 64);
-	platform_set_drvdata(pdev, p);
-
-	return 0;
-}
-
-static int tpu_probe(struct platform_device *pdev)
-{
-	struct tpu_priv *p = platform_get_drvdata(pdev);
-
-	if (p) {
-		dev_info(&pdev->dev, "kept as earlytimer\n");
-		return 0;
+	base[CH_H] = of_iomap(node, CH_H);
+	if (!base[CH_H]) {
+		pr_err("failed to map registers for clocksource\n");
+		goto unmap_L;
 	}
 
-	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
+	tpu_priv.mapbase1 = (unsigned long)base[CH_L];
+	tpu_priv.mapbase2 = (unsigned long)base[CH_H];
 
-	return tpu_setup(p, pdev);
-}
+	clocksource_register_hz(&tpu_priv.cs, clk_get_rate(clk) / 64);
 
-static int tpu_remove(struct platform_device *pdev)
-{
-	return -EBUSY;
-}
+	return;
 
-static const struct of_device_id tpu_of_table[] = {
-	{ .compatible = "renesas,tpu" },
-	{ }
-};
-
-static struct platform_driver tpu_driver = {
-	.probe		= tpu_probe,
-	.remove		= tpu_remove,
-	.driver		= {
-		.name	= "h8s-tpu",
-		.of_match_table = of_match_ptr(tpu_of_table),
-	}
-};
-
-static int __init tpu_init(void)
-{
-	return platform_driver_register(&tpu_driver);
-}
-
-static void __exit tpu_exit(void)
-{
-	platform_driver_unregister(&tpu_driver);
+unmap_L:
+	iounmap(base[CH_H]);
+free_clk:
+	clk_put(clk);
 }
 
-subsys_initcall(tpu_init);
-module_exit(tpu_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8S Timer Pulse Unit Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_tpu, "renesas,tpu", h8300_tpu_init);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 38/69] clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The dev_warn is using the platform driver which was removed in the previous
patch.

Let's replace dev_warn by pr_warn.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index f0680eb..35b0e8f 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -98,7 +98,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 	raw_spin_lock_irqsave(&p->lock, flags);
 	if (delta >= 0x10000)
-		dev_warn(&p->pdev->dev, "delta out of range\n");
+		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
 	p->tcora = delta;
 	ctrl_outb(ctrl_inb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 38/69] clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

The dev_warn is using the platform driver which was removed in the previous
patch.

Let's replace dev_warn by pr_warn.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index f0680eb..35b0e8f 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -98,7 +98,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 	raw_spin_lock_irqsave(&p->lock, flags);
 	if (delta >= 0x10000)
-		dev_warn(&p->pdev->dev, "delta out of range\n");
+		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
 	p->tcora = delta;
 	ctrl_outb(ctrl_inb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 39/69] clocksource/drivers/h8300_tpu: Remove unused macros
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

Some macros are unused, delete them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_tpu.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index ed0b493..576dae6 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -20,16 +20,9 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#define TCR	0
-#define TMDR	1
-#define TIOR	2
-#define TER	4
-#define TSR	5
-#define TCNT	6
-#define TGRA	8
-#define TGRB	10
-#define TGRC	12
-#define TGRD	14
+#define TCR	0x0
+#define TSR	0x5
+#define TCNT	0x6
 
 struct tpu_priv {
 	struct clocksource cs;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 39/69] clocksource/drivers/h8300_tpu: Remove unused macros
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Some macros are unused, delete them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_tpu.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index ed0b493..576dae6 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -20,16 +20,9 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#define TCR	0
-#define TMDR	1
-#define TIOR	2
-#define TER	4
-#define TSR	5
-#define TCNT	6
-#define TGRA	8
-#define TGRB	10
-#define TGRC	12
-#define TGRD	14
+#define TCR	0x0
+#define TSR	0x5
+#define TCNT	0x6
 
 struct tpu_priv {
 	struct clocksource cs;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 40/69] clocksource/drivers/h8300_tpu: Remove pointless headers for TPU
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_tpu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 576dae6..c1eef42 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -6,14 +6,9 @@
  */
 
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
 #include <linux/clocksource.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 40/69] clocksource/drivers/h8300_tpu: Remove pointless headers for TPU
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_tpu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 576dae6..c1eef42 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -6,14 +6,9 @@
  */
 
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
 #include <linux/clocksource.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 41/69] clocksource/drivers/h8300_timer8: Remove unused headers
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 35b0e8f..62a7f8c 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -8,21 +8,16 @@
  */
 
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/slab.h>
 #include <linux/clockchips.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#include <asm/irq.h>
-
 #define _8TCR	0
 #define _8TCSR	2
 #define TCORA	4
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 41/69] clocksource/drivers/h8300_timer8: Remove unused headers
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 35b0e8f..62a7f8c 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -8,21 +8,16 @@
  */
 
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/slab.h>
 #include <linux/clockchips.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#include <asm/irq.h>
-
 #define _8TCR	0
 #define _8TCSR	2
 #define TCORA	4
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 42/69] clocksource/drivers/h8300_timer8: Remove unused macros
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 62a7f8c..88b9b06 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,7 +24,6 @@
 #define TCORB	6
 #define _8TCNT	8
 
-#define FLAG_REPROGRAM (1 << 0)
 #define FLAG_SKIPEVENT (1 << 1)
 #define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
@@ -32,9 +31,6 @@
 #define ONESHOT  0
 #define PERIODIC 1
 
-#define RELATIVE 0
-#define ABSOLUTE 1
-
 #define SCALE 64
 
 struct timer8_priv {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 42/69] clocksource/drivers/h8300_timer8: Remove unused macros
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 62a7f8c..88b9b06 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,7 +24,6 @@
 #define TCORB	6
 #define _8TCNT	8
 
-#define FLAG_REPROGRAM (1 << 0)
 #define FLAG_SKIPEVENT (1 << 1)
 #define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
@@ -32,9 +31,6 @@
 #define ONESHOT  0
 #define PERIODIC 1
 
-#define RELATIVE 0
-#define ABSOLUTE 1
-
 #define SCALE 64
 
 struct timer8_priv {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 43/69] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

Specify the delta as parameter for the timer8_clock_event_start function
instead of using a macro to tell PERIODIC or ONESHOT.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 88b9b06..2433325 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -28,9 +28,6 @@
 #define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
 
-#define ONESHOT  0
-#define PERIODIC 1
-
 #define SCALE 64
 
 struct timer8_priv {
@@ -147,7 +144,7 @@ static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
 	return container_of(ced, struct timer8_priv, ced);
 }
 
-static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
+static void timer8_clock_event_start(struct timer8_priv *p, unsigned long delta)
 {
 	struct clock_event_device *ced = &p->ced;
 
@@ -158,7 +155,7 @@ static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
 	ced->max_delta_ns = clockevent_delta2ns(0xffff, ced);
 	ced->min_delta_ns = clockevent_delta2ns(0x0001, ced);
 
-	timer8_set_next(p, periodic?(p->rate + HZ/2) / HZ:0x10000);
+	timer8_set_next(p, delta);
 }
 
 static int timer8_clock_event_shutdown(struct clock_event_device *ced)
@@ -173,7 +170,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
 
 	pr_info("%s: used for periodic clock events\n", ced->name);
 	timer8_stop(p);
-	timer8_clock_event_start(p, PERIODIC);
+	timer8_clock_event_start(p, (p->rate + HZ/2) / HZ);
 
 	return 0;
 }
@@ -184,7 +181,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
 
 	pr_info("%s: used for oneshot clock events\n", ced->name);
 	timer8_stop(p);
-	timer8_clock_event_start(p, ONESHOT);
+	timer8_clock_event_start(p, 0x10000);
 
 	return 0;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 43/69] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

Specify the delta as parameter for the timer8_clock_event_start function
instead of using a macro to tell PERIODIC or ONESHOT.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 88b9b06..2433325 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -28,9 +28,6 @@
 #define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
 
-#define ONESHOT  0
-#define PERIODIC 1
-
 #define SCALE 64
 
 struct timer8_priv {
@@ -147,7 +144,7 @@ static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
 	return container_of(ced, struct timer8_priv, ced);
 }
 
-static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
+static void timer8_clock_event_start(struct timer8_priv *p, unsigned long delta)
 {
 	struct clock_event_device *ced = &p->ced;
 
@@ -158,7 +155,7 @@ static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
 	ced->max_delta_ns = clockevent_delta2ns(0xffff, ced);
 	ced->min_delta_ns = clockevent_delta2ns(0x0001, ced);
 
-	timer8_set_next(p, periodic?(p->rate + HZ/2) / HZ:0x10000);
+	timer8_set_next(p, delta);
 }
 
 static int timer8_clock_event_shutdown(struct clock_event_device *ced)
@@ -173,7 +170,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
 
 	pr_info("%s: used for periodic clock events\n", ced->name);
 	timer8_stop(p);
-	timer8_clock_event_start(p, PERIODIC);
+	timer8_clock_event_start(p, (p->rate + HZ/2) / HZ);
 
 	return 0;
 }
@@ -184,7 +181,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
 
 	pr_info("%s: used for oneshot clock events\n", ced->name);
 	timer8_stop(p);
-	timer8_clock_event_start(p, ONESHOT);
+	timer8_clock_event_start(p, 0x10000);
 
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 44/69] clocksource/drivers/h8300_timer8: Fix irq return value check
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The value returned in case of error for the 'irq_of_parse_and_map' function is
zero in case of error. Fix the check in the init code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 2433325..3eedeff 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -230,7 +230,7 @@ static void __init h8300_8timer_init(struct device_node *node)
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		pr_err("failed to get irq for clockevent\n");
 		goto unmap_reg;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 44/69] clocksource/drivers/h8300_timer8: Fix irq return value check
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

The value returned in case of error for the 'irq_of_parse_and_map' function is
zero in case of error. Fix the check in the init code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 2433325..3eedeff 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -230,7 +230,7 @@ static void __init h8300_8timer_init(struct device_node *node)
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		pr_err("failed to get irq for clockevent\n");
 		goto unmap_reg;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 45/69] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The current code assumes the interrupt function is re-entrant.

That is not correct. An interrupt handler is never invoked concurrently. The
interrupt line is masked on all processors.

Remove the chewing flags in the code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 3eedeff..7111b99 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,8 +24,6 @@
 #define TCORB	6
 #define _8TCNT	8
 
-#define FLAG_SKIPEVENT (1 << 1)
-#define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
 
 #define SCALE 64
@@ -67,14 +65,13 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 
 	ctrl_outb(ctrl_inb(p->mapbase + _8TCSR) & ~0x40,
 		  p->mapbase + _8TCSR);
-	p->flags |= FLAG_IRQCONTEXT;
+
 	ctrl_outw(p->tcora, p->mapbase + TCORA);
-	if (!(p->flags & FLAG_SKIPEVENT)) {
-		if (clockevent_state_oneshot(&p->ced))
-			ctrl_outw(0x0000, p->mapbase + _8TCR);
-		p->ced.event_handler(&p->ced);
-	}
-	p->flags &= ~(FLAG_SKIPEVENT | FLAG_IRQCONTEXT);
+
+	if (clockevent_state_oneshot(&p->ced))
+		ctrl_outw(0x0000, p->mapbase + _8TCR);
+
+	p->ced.event_handler(&p->ced);
 
 	return IRQ_HANDLED;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 45/69] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

The current code assumes the interrupt function is re-entrant.

That is not correct. An interrupt handler is never invoked concurrently. The
interrupt line is masked on all processors.

Remove the chewing flags in the code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 3eedeff..7111b99 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,8 +24,6 @@
 #define TCORB	6
 #define _8TCNT	8
 
-#define FLAG_SKIPEVENT (1 << 1)
-#define FLAG_IRQCONTEXT (1 << 2)
 #define FLAG_STARTED (1 << 3)
 
 #define SCALE 64
@@ -67,14 +65,13 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 
 	ctrl_outb(ctrl_inb(p->mapbase + _8TCSR) & ~0x40,
 		  p->mapbase + _8TCSR);
-	p->flags |= FLAG_IRQCONTEXT;
+
 	ctrl_outw(p->tcora, p->mapbase + TCORA);
-	if (!(p->flags & FLAG_SKIPEVENT)) {
-		if (clockevent_state_oneshot(&p->ced))
-			ctrl_outw(0x0000, p->mapbase + _8TCR);
-		p->ced.event_handler(&p->ced);
-	}
-	p->flags &= ~(FLAG_SKIPEVENT | FLAG_IRQCONTEXT);
+
+	if (clockevent_state_oneshot(&p->ced))
+		ctrl_outw(0x0000, p->mapbase + _8TCR);
+
+	p->ced.event_handler(&p->ced);
 
 	return IRQ_HANDLED;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 46/69] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:17     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The time framawork takes care of disabling the interrupts and takes a lock
to prevent races.

Remove the legacy code in the driver taking care of the races.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 7111b99..24d91b1 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -31,7 +31,6 @@
 struct timer8_priv {
 	struct clock_event_device ced;
 	unsigned long mapbase;
-	raw_spinlock_t lock;
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
@@ -78,10 +77,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 
 static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
-	unsigned long flags;
 	unsigned long now;
 
-	raw_spin_lock_irqsave(&p->lock, flags);
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
@@ -91,8 +88,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 		ctrl_outw(delta, p->mapbase + TCORA);
 	else
 		ctrl_outw(now + 1, p->mapbase + TCORA);
-
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 }
 
 static int timer8_enable(struct timer8_priv *p)
@@ -108,9 +103,6 @@ static int timer8_enable(struct timer8_priv *p)
 static int timer8_start(struct timer8_priv *p)
 {
 	int ret = 0;
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&p->lock, flags);
 
 	if (!(p->flags & FLAG_STARTED))
 		ret = timer8_enable(p);
@@ -120,20 +112,12 @@ static int timer8_start(struct timer8_priv *p)
 	p->flags |= FLAG_STARTED;
 
  out:
-	raw_spin_unlock_irqrestore(&p->lock, flags);
-
 	return ret;
 }
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&p->lock, flags);
-
 	ctrl_outw(0x0000, p->mapbase + _8TCR);
-
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 46/69] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code
@ 2015-12-18 14:17     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

The time framawork takes care of disabling the interrupts and takes a lock
to prevent races.

Remove the legacy code in the driver taking care of the races.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 7111b99..24d91b1 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -31,7 +31,6 @@
 struct timer8_priv {
 	struct clock_event_device ced;
 	unsigned long mapbase;
-	raw_spinlock_t lock;
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
@@ -78,10 +77,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 
 static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
-	unsigned long flags;
 	unsigned long now;
 
-	raw_spin_lock_irqsave(&p->lock, flags);
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
@@ -91,8 +88,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 		ctrl_outw(delta, p->mapbase + TCORA);
 	else
 		ctrl_outw(now + 1, p->mapbase + TCORA);
-
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 }
 
 static int timer8_enable(struct timer8_priv *p)
@@ -108,9 +103,6 @@ static int timer8_enable(struct timer8_priv *p)
 static int timer8_start(struct timer8_priv *p)
 {
 	int ret = 0;
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&p->lock, flags);
 
 	if (!(p->flags & FLAG_STARTED))
 		ret = timer8_enable(p);
@@ -120,20 +112,12 @@ static int timer8_start(struct timer8_priv *p)
 	p->flags |= FLAG_STARTED;
 
  out:
-	raw_spin_unlock_irqrestore(&p->lock, flags);
-
 	return ret;
 }
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&p->lock, flags);
-
 	ctrl_outw(0x0000, p->mapbase + _8TCR);
-
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 47/69] clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The current code retrieves the rate value when the timer is enabled which
occurs each time a timer is re-armed. Except if the clock frequency has changed
magically I don't see why this should be done each time.

Retrieve the clock rate value at init time only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 24d91b1..187c416 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -34,7 +34,6 @@ struct timer8_priv {
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
-	struct clk *pclk;
 };
 
 static unsigned long timer8_get_counter(struct timer8_priv *p)
@@ -92,7 +91,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	p->rate = clk_get_rate(p->pclk) / SCALE;
 	ctrl_outw(0xffff, p->mapbase + TCORA);
 	ctrl_outw(0x0000, p->mapbase + _8TCNT);
 	ctrl_outw(0x0c02, p->mapbase + _8TCR);
@@ -102,16 +100,15 @@ static int timer8_enable(struct timer8_priv *p)
 
 static int timer8_start(struct timer8_priv *p)
 {
-	int ret = 0;
+	int ret;
 
-	if (!(p->flags & FLAG_STARTED))
-		ret = timer8_enable(p);
+	if ((p->flags & FLAG_STARTED))
+		return 0;
 
-	if (ret)
-		goto out;
-	p->flags |= FLAG_STARTED;
+	ret = timer8_enable(p);
+	if (!ret)
+		p->flags |= FLAG_STARTED;
 
- out:
 	return ret;
 }
 
@@ -217,7 +214,12 @@ static void __init h8300_8timer_init(struct device_node *node)
 	}
 
 	timer8_priv.mapbase = (unsigned long)base;
-	timer8_priv.pclk = clk;
+
+	rate = clk_get_rate(clk) / SCALE;
+	if (!rate) {
+		pr_err("Failed to get rate for the clocksource\n");
+		goto unmap_reg;
+	}
 
 	ret = request_irq(irq, timer8_interrupt,
 			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
@@ -225,10 +227,10 @@ static void __init h8300_8timer_init(struct device_node *node)
 		pr_err("failed to request irq %d for clockevent\n", irq);
 		goto unmap_reg;
 	}
-	rate = clk_get_rate(clk) / SCALE;
+
 	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
-	return;
 
+	return;
 unmap_reg:
 	iounmap(base);
 free_clk:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 47/69] clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The current code retrieves the rate value when the timer is enabled which
occurs each time a timer is re-armed. Except if the clock frequency has changed
magically I don't see why this should be done each time.

Retrieve the clock rate value at init time only.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 24d91b1..187c416 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -34,7 +34,6 @@ struct timer8_priv {
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
-	struct clk *pclk;
 };
 
 static unsigned long timer8_get_counter(struct timer8_priv *p)
@@ -92,7 +91,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	p->rate = clk_get_rate(p->pclk) / SCALE;
 	ctrl_outw(0xffff, p->mapbase + TCORA);
 	ctrl_outw(0x0000, p->mapbase + _8TCNT);
 	ctrl_outw(0x0c02, p->mapbase + _8TCR);
@@ -102,16 +100,15 @@ static int timer8_enable(struct timer8_priv *p)
 
 static int timer8_start(struct timer8_priv *p)
 {
-	int ret = 0;
+	int ret;
 
-	if (!(p->flags & FLAG_STARTED))
-		ret = timer8_enable(p);
+	if ((p->flags & FLAG_STARTED))
+		return 0;
 
-	if (ret)
-		goto out;
-	p->flags |= FLAG_STARTED;
+	ret = timer8_enable(p);
+	if (!ret)
+		p->flags |= FLAG_STARTED;
 
- out:
 	return ret;
 }
 
@@ -217,7 +214,12 @@ static void __init h8300_8timer_init(struct device_node *node)
 	}
 
 	timer8_priv.mapbase = (unsigned long)base;
-	timer8_priv.pclk = clk;
+
+	rate = clk_get_rate(clk) / SCALE;
+	if (!rate) {
+		pr_err("Failed to get rate for the clocksource\n");
+		goto unmap_reg;
+	}
 
 	ret = request_irq(irq, timer8_interrupt,
 			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
@@ -225,10 +227,10 @@ static void __init h8300_8timer_init(struct device_node *node)
 		pr_err("failed to request irq %d for clockevent\n", irq);
 		goto unmap_reg;
 	}
-	rate = clk_get_rate(clk) / SCALE;
+
 	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
-	return;
 
+	return;
 unmap_reg:
 	iounmap(base);
 free_clk:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 48/69] clocksource/drivers/h8300_timer16: Remove pointless headers
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The headers are not needed, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index cdf0d83..1c9dd02 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -4,25 +4,15 @@
  *  Copyright 2015 Yoshinori Sato <ysato@users.sourcefoge.jp>
  */
 
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/string.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/clocksource.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#include <asm/segment.h>
-#include <asm/irq.h>
-
 #define TSTR	0
 #define TSNC	1
 #define TMDR	2
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 48/69] clocksource/drivers/h8300_timer16: Remove pointless headers
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The headers are not needed, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index cdf0d83..1c9dd02 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -4,25 +4,15 @@
  *  Copyright 2015 Yoshinori Sato <ysato@users.sourcefoge.jp>
  */
 
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/string.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/clocksource.h>
-#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
-#include <asm/segment.h>
-#include <asm/irq.h>
-
 #define TSTR	0
 #define TSNC	1
 #define TMDR	2
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 49/69] clocksource/drivers/h8300_timer16: Remove unused macros
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The macros are no longer used in the code, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 1c9dd02..bc9289b 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -14,29 +14,11 @@
 #include <linux/of_irq.h>
 
 #define TSTR	0
-#define TSNC	1
-#define TMDR	2
-#define TOLR	3
 #define TISRA	4
-#define TISRB	5
 #define TISRC	6
 
 #define TCR	0
-#define TIOR	1
 #define TCNT	2
-#define GRA	4
-#define GRB	6
-
-#define FLAG_REPROGRAM (1 << 0)
-#define FLAG_SKIPEVENT (1 << 1)
-#define FLAG_IRQCONTEXT (1 << 2)
-#define FLAG_STARTED (1 << 3)
-
-#define ONESHOT  0
-#define PERIODIC 1
-
-#define RELATIVE 0
-#define ABSOLUTE 1
 
 struct timer16_priv {
 	struct clocksource cs;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 49/69] clocksource/drivers/h8300_timer16: Remove unused macros
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The macros are no longer used in the code, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 1c9dd02..bc9289b 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -14,29 +14,11 @@
 #include <linux/of_irq.h>
 
 #define TSTR	0
-#define TSNC	1
-#define TMDR	2
-#define TOLR	3
 #define TISRA	4
-#define TISRB	5
 #define TISRC	6
 
 #define TCR	0
-#define TIOR	1
 #define TCNT	2
-#define GRA	4
-#define GRB	6
-
-#define FLAG_REPROGRAM (1 << 0)
-#define FLAG_SKIPEVENT (1 << 1)
-#define FLAG_IRQCONTEXT (1 << 2)
-#define FLAG_STARTED (1 << 3)
-
-#define ONESHOT  0
-#define PERIODIC 1
-
-#define RELATIVE 0
-#define ABSOLUTE 1
 
 struct timer16_priv {
 	struct clocksource cs;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 50/69] clocksource/drivers/h8300_timer16: Remove unused fields in timer16_priv
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The fields are not used in the code, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index bc9289b..6705bf7 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -25,8 +25,6 @@ struct timer16_priv {
 	unsigned long total_cycles;
 	unsigned long mapbase;
 	unsigned long mapcommon;
-	unsigned long flags;
-	unsigned short gra;
 	unsigned short cs_enabled;
 	unsigned char enb;
 	unsigned char imfa;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 50/69] clocksource/drivers/h8300_timer16: Remove unused fields in timer16_priv
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The fields are not used in the code, remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index bc9289b..6705bf7 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -25,8 +25,6 @@ struct timer16_priv {
 	unsigned long total_cycles;
 	unsigned long mapbase;
 	unsigned long mapcommon;
-	unsigned long flags;
-	unsigned short gra;
 	unsigned short cs_enabled;
 	unsigned char enb;
 	unsigned char imfa;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 51/69] clocksource/drivers/h8300_timer16: Fix irq return value check
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The function irq_of_parse_and_map returns zero in case of failure.

Fix the return code test to check against zero.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 6705bf7..129dca0 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -155,7 +155,7 @@ static void __init h8300_16timer_init(struct device_node *node)
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		pr_err("failed to get irq for clockevent\n");
 		goto unmap_comm;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 51/69] clocksource/drivers/h8300_timer16: Fix irq return value check
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The function irq_of_parse_and_map returns zero in case of failure.

Fix the return code test to check against zero.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 6705bf7..129dca0 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -155,7 +155,7 @@ static void __init h8300_16timer_init(struct device_node *node)
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		pr_err("failed to get irq for clockevent\n");
 		goto unmap_comm;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 52/69] clocksource/drivers/h8300_timer16: Remove pointless lock
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The lock in the timer16_clocksource_read is not needed, remove it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 129dca0..f396605 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -30,7 +30,6 @@ struct timer16_priv {
 	unsigned char imfa;
 	unsigned char imiea;
 	unsigned char ovf;
-	raw_spinlock_t lock;
 	struct clk *clk;
 };
 
@@ -75,13 +74,10 @@ static inline struct timer16_priv *cs_to_priv(struct clocksource *cs)
 static cycle_t timer16_clocksource_read(struct clocksource *cs)
 {
 	struct timer16_priv *p = cs_to_priv(cs);
-	unsigned long flags, raw;
-	unsigned long value;
+	unsigned long raw, value;
 
-	raw_spin_lock_irqsave(&p->lock, flags);
 	value = p->total_cycles;
 	raw = timer16_get_counter(p);
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 
 	return value + raw;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 52/69] clocksource/drivers/h8300_timer16: Remove pointless lock
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The lock in the timer16_clocksource_read is not needed, remove it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 129dca0..f396605 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -30,7 +30,6 @@ struct timer16_priv {
 	unsigned char imfa;
 	unsigned char imiea;
 	unsigned char ovf;
-	raw_spinlock_t lock;
 	struct clk *clk;
 };
 
@@ -75,13 +74,10 @@ static inline struct timer16_priv *cs_to_priv(struct clocksource *cs)
 static cycle_t timer16_clocksource_read(struct clocksource *cs)
 {
 	struct timer16_priv *p = cs_to_priv(cs);
-	unsigned long flags, raw;
-	unsigned long value;
+	unsigned long raw, value;
 
-	raw_spin_lock_irqsave(&p->lock, flags);
 	value = p->total_cycles;
 	raw = timer16_get_counter(p);
-	raw_spin_unlock_irqrestore(&p->lock, flags);
 
 	return value + raw;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 53/69] clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Maxime Ripard, Chen-Yu Tsai

The current code to initialize, register and read the clocksource is
already factored out in mmio.c via the clocksource_mmio_init function.

The only difference is the readl vs readl_relaxed.

Factor out the code with the clocksource_mmio_init function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clocksource/timer-sun5i.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index bca9573..24c83f9 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -152,13 +152,6 @@ static irqreturn_t sun5i_timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static cycle_t sun5i_clksrc_read(struct clocksource *clksrc)
-{
-	struct sun5i_timer_clksrc *cs = to_sun5i_timer_clksrc(clksrc);
-
-	return ~readl(cs->timer.base + TIMER_CNTVAL_LO_REG(1));
-}
-
 static int sun5i_rate_cb_clksrc(struct notifier_block *nb,
 				unsigned long event, void *data)
 {
@@ -217,13 +210,8 @@ static int __init sun5i_setup_clocksource(struct device_node *node,
 	writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
 	       base + TIMER_CTL_REG(1));
 
-	cs->clksrc.name = node->name;
-	cs->clksrc.rating = 340;
-	cs->clksrc.read = sun5i_clksrc_read;
-	cs->clksrc.mask = CLOCKSOURCE_MASK(32);
-	cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
-
-	ret = clocksource_register_hz(&cs->clksrc, rate);
+	ret = clocksource_mmio_init(base + TIMER_CNTVAL_LO_REG(1), node->name,
+				    rate, 340, 32, clocksource_mmio_readl_down);
 	if (ret) {
 		pr_err("Couldn't register clock source.\n");
 		goto err_remove_notifier;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 53/69] clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The current code to initialize, register and read the clocksource is
already factored out in mmio.c via the clocksource_mmio_init function.

The only difference is the readl vs readl_relaxed.

Factor out the code with the clocksource_mmio_init function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clocksource/timer-sun5i.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index bca9573..24c83f9 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -152,13 +152,6 @@ static irqreturn_t sun5i_timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static cycle_t sun5i_clksrc_read(struct clocksource *clksrc)
-{
-	struct sun5i_timer_clksrc *cs = to_sun5i_timer_clksrc(clksrc);
-
-	return ~readl(cs->timer.base + TIMER_CNTVAL_LO_REG(1));
-}
-
 static int sun5i_rate_cb_clksrc(struct notifier_block *nb,
 				unsigned long event, void *data)
 {
@@ -217,13 +210,8 @@ static int __init sun5i_setup_clocksource(struct device_node *node,
 	writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
 	       base + TIMER_CTL_REG(1));
 
-	cs->clksrc.name = node->name;
-	cs->clksrc.rating = 340;
-	cs->clksrc.read = sun5i_clksrc_read;
-	cs->clksrc.mask = CLOCKSOURCE_MASK(32);
-	cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
-
-	ret = clocksource_register_hz(&cs->clksrc, rate);
+	ret = clocksource_mmio_init(base + TIMER_CNTVAL_LO_REG(1), node->name,
+				    rate, 340, 32, clocksource_mmio_readl_down);
 	if (ret) {
 		pr_err("Couldn't register clock source.\n");
 		goto err_remove_notifier;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 54/69] clocksource/drivers/h8300_timer8: Separate the Kconfig option from the arch
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

The current Kconfig option is the H8300 arch option. In order to comply to the
current rule, let's create a specific option for the timer8 and select it
from the arch's Kconfig.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/h8300/Kconfig           | 1 +
 drivers/clocksource/Kconfig  | 3 +++
 drivers/clocksource/Makefile | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index dd3ac75..2e20333 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -17,6 +17,7 @@ config H8300
 	select HAVE_MEMBLOCK
 	select HAVE_DMA_ATTRS
 	select CLKSRC_OF
+	select H8300_TMR8
 
 config RWSEM_GENERIC_SPINLOCK
 	def_bool y
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index de331b8..73477b5 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -362,6 +362,9 @@ config CLKSRC_PXA
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
 
+config H8300_TMR8
+        bool
+
 config H8300_TMR16
         bool
 
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 56bd16e..dc2b899 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -60,7 +60,7 @@ obj-$(CONFIG_CLKSRC_MIPS_GIC)		+= mips-gic-timer.o
 obj-$(CONFIG_CLKSRC_TANGO_XTAL)		+= tango_xtal.o
 obj-$(CONFIG_CLKSRC_IMX_GPT)		+= timer-imx-gpt.o
 obj-$(CONFIG_ASM9260_TIMER)		+= asm9260_timer.o
-obj-$(CONFIG_H8300)			+= h8300_timer8.o
+obj-$(CONFIG_H8300_TMR8)		+= h8300_timer8.o
 obj-$(CONFIG_H8300_TMR16)		+= h8300_timer16.o
 obj-$(CONFIG_H8300_TPU)			+= h8300_tpu.o
 obj-$(CONFIG_CLKSRC_ST_LPC)		+= clksrc_st_lpc.o
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 54/69] clocksource/drivers/h8300_timer8: Separate the Kconfig option from the arch
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The current Kconfig option is the H8300 arch option. In order to comply to the
current rule, let's create a specific option for the timer8 and select it
from the arch's Kconfig.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/h8300/Kconfig           | 1 +
 drivers/clocksource/Kconfig  | 3 +++
 drivers/clocksource/Makefile | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index dd3ac75..2e20333 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -17,6 +17,7 @@ config H8300
 	select HAVE_MEMBLOCK
 	select HAVE_DMA_ATTRS
 	select CLKSRC_OF
+	select H8300_TMR8
 
 config RWSEM_GENERIC_SPINLOCK
 	def_bool y
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index de331b8..73477b5 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -362,6 +362,9 @@ config CLKSRC_PXA
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
 
+config H8300_TMR8
+        bool
+
 config H8300_TMR16
         bool
 
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 56bd16e..dc2b899 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -60,7 +60,7 @@ obj-$(CONFIG_CLKSRC_MIPS_GIC)		+= mips-gic-timer.o
 obj-$(CONFIG_CLKSRC_TANGO_XTAL)		+= tango_xtal.o
 obj-$(CONFIG_CLKSRC_IMX_GPT)		+= timer-imx-gpt.o
 obj-$(CONFIG_ASM9260_TIMER)		+= asm9260_timer.o
-obj-$(CONFIG_H8300)			+= h8300_timer8.o
+obj-$(CONFIG_H8300_TMR8)		+= h8300_timer8.o
 obj-$(CONFIG_H8300_TMR16)		+= h8300_timer16.o
 obj-$(CONFIG_H8300_TPU)			+= h8300_tpu.o
 obj-$(CONFIG_CLKSRC_ST_LPC)		+= clksrc_st_lpc.o
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 55/69] h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	Jason Cooper, Marc Zyngier, moderated list:H8/300 ARCHITECTURE

For the sake of consistency, let rename all ctrl_out/in calls to the write/read
calls so we have the same API consistent with the other architectures hence
open the door for the increasing of the test compilation coverage.

The unsigned long coercive cast is removed because all variables are set to
the right type "void __iomem *".

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/h8300/include/asm/io.h          | 39 +++++++++++++++++++++---------------
 arch/h8300/kernel/setup.c            |  8 ++++----
 drivers/clocksource/h8300_timer16.c  | 28 +++++++++++++-------------
 drivers/clocksource/h8300_timer8.c   | 34 +++++++++++++++----------------
 drivers/clocksource/h8300_tpu.c      | 28 +++++++++++++-------------
 drivers/irqchip/irq-renesas-h8300h.c |  8 ++++----
 6 files changed, 76 insertions(+), 69 deletions(-)

diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h
index bb837cd..f0e14f3 100644
--- a/arch/h8300/include/asm/io.h
+++ b/arch/h8300/include/asm/io.h
@@ -3,40 +3,45 @@
 
 #ifdef __KERNEL__
 
-#include <asm-generic/io.h>
-
 /* H8/300 internal I/O functions */
-static inline unsigned char ctrl_inb(unsigned long addr)
+
+#define __raw_readb __raw_readb
+static inline u8 __raw_readb(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned char *)addr;
+	return *(volatile u8 *)addr;
 }
 
-static inline unsigned short ctrl_inw(unsigned long addr)
+#define __raw_readw __raw_readw
+static inline u16 __raw_readw(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned short *)addr;
+	return *(volatile u16 *)addr;
 }
 
-static inline unsigned long ctrl_inl(unsigned long addr)
+#define __raw_readl __raw_readl
+static inline u32  __raw_readl(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned long *)addr;
+	return *(volatile u32 *)addr;
 }
 
-static inline void ctrl_outb(unsigned char b, unsigned long addr)
+#define __raw_writeb __raw_writeb
+static inline void __raw_writeb(u8 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned char *)addr = b;
+	*(volatile u8 *)addr = b;
 }
 
-static inline void ctrl_outw(unsigned short b, unsigned long addr)
+#define __raw_writew __raw_writew
+static inline void __raw_writew(u16 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned short *)addr = b;
+	*(volatile u16 *)addr = b;
 }
 
-static inline void ctrl_outl(unsigned long b, unsigned long addr)
+#define __raw_writel __raw_writel
+static inline void __raw_writel(u32 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned long *)addr = b;
+	*(volatile u32 *)addr = b;
 }
 
-static inline void ctrl_bclr(int b, unsigned char *addr)
+static inline void ctrl_bclr(int b, void __iomem *addr)
 {
 	if (__builtin_constant_p(b))
 		__asm__("bclr %1,%0" : "+WU"(*addr): "i"(b));
@@ -44,7 +49,7 @@ static inline void ctrl_bclr(int b, unsigned char *addr)
 		__asm__("bclr %w1,%0" : "+WU"(*addr): "r"(b));
 }
 
-static inline void ctrl_bset(int b, unsigned char *addr)
+static inline void ctrl_bset(int b, void __iomem *addr)
 {
 	if (__builtin_constant_p(b))
 		__asm__("bset %1,%0" : "+WU"(*addr): "i"(b));
@@ -52,6 +57,8 @@ static inline void ctrl_bset(int b, unsigned char *addr)
 		__asm__("bset %w1,%0" : "+WU"(*addr): "r"(b));
 }
 
+#include <asm-generic/io.h>
+
 #endif /* __KERNEL__ */
 
 #endif /* _H8300_IO_H */
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index c772abe..e4985df 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -207,14 +207,14 @@ device_initcall(device_probe);
 #define get_wait(base, addr) ({		\
 	int baddr;			\
 	baddr = ((addr) / 0x200000 * 2);			     \
-	w *= (ctrl_inw((unsigned long)(base) + 2) & (3 << baddr)) + 1;	\
+	w *= (readw((base) + 2) & (3 << baddr)) + 1;		     \
 	})
 #endif
 #if defined(CONFIG_CPU_H8S)
 #define get_wait(base, addr) ({		\
 	int baddr;			\
 	baddr = ((addr) / 0x200000 * 16);			     \
-	w *= (ctrl_inl((unsigned long)(base) + 2) & (7 << baddr)) + 1;	\
+	w *= (readl((base) + 2) & (7 << baddr)) + 1;	\
 	})
 #endif
 
@@ -228,8 +228,8 @@ static __init int access_timing(void)
 
 	bsc = of_find_compatible_node(NULL, NULL, "renesas,h8300-bsc");
 	base = of_iomap(bsc, 0);
-	w = (ctrl_inb((unsigned long)base + 0) & bit)?2:1;
-	if (ctrl_inb((unsigned long)base + 1) & bit)
+	w = (readb(base + 0) & bit)?2:1;
+	if (readb(base + 1) & bit)
 		w *= get_wait(base, addr);
 	else
 		w *= 2;
diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index f396605..fc14a3f 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -23,8 +23,8 @@
 struct timer16_priv {
 	struct clocksource cs;
 	unsigned long total_cycles;
-	unsigned long mapbase;
-	unsigned long mapcommon;
+	void __iomem *mapbase;
+	void __iomem *mapcommon;
 	unsigned short cs_enabled;
 	unsigned char enb;
 	unsigned char imfa;
@@ -38,15 +38,15 @@ static unsigned long timer16_get_counter(struct timer16_priv *p)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapcommon + TISRC) & p->ovf;
+	o1 = readb(p->mapcommon + TISRC) & p->ovf;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = ctrl_inw(p->mapbase + TCNT);
-		v2 = ctrl_inw(p->mapbase + TCNT);
-		v3 = ctrl_inw(p->mapbase + TCNT);
-		o1 = ctrl_inb(p->mapcommon + TISRC) & p->ovf;
+		v1 = readw(p->mapbase + TCNT);
+		v2 = readw(p->mapbase + TCNT);
+		v3 = readw(p->mapbase + TCNT);
+		o1 = readb(p->mapcommon + TISRC) & p->ovf;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -59,7 +59,7 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	ctrl_outb(ctrl_inb(p->mapcommon + TISRA) & ~p->imfa,
+	writeb(readb(p->mapcommon + TISRA) & ~p->imfa,
 		  p->mapcommon + TISRA);
 	p->total_cycles += 0x10000;
 
@@ -89,9 +89,9 @@ static int timer16_enable(struct clocksource *cs)
 	WARN_ON(p->cs_enabled);
 
 	p->total_cycles = 0;
-	ctrl_outw(0x0000, p->mapbase + TCNT);
-	ctrl_outb(0x83, p->mapbase + TCR);
-	ctrl_outb(ctrl_inb(p->mapcommon + TSTR) | p->enb,
+	writew(0x0000, p->mapbase + TCNT);
+	writeb(0x83, p->mapbase + TCR);
+	writeb(readb(p->mapcommon + TSTR) | p->enb,
 		  p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
@@ -104,7 +104,7 @@ static void timer16_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	ctrl_outb(ctrl_inb(p->mapcommon + TSTR) & ~p->enb,
+	writeb(readb(p->mapcommon + TSTR) & ~p->enb,
 		  p->mapcommon + TSTR);
 
 	p->cs_enabled = false;
@@ -158,8 +158,8 @@ static void __init h8300_16timer_init(struct device_node *node)
 
 	of_property_read_u32(node, "renesas,channel", &ch);
 
-	timer16_priv.mapbase = (unsigned long)base[REG_CH];
-	timer16_priv.mapcommon = (unsigned long)base[REG_COMM];
+	timer16_priv.mapbase = base[REG_CH];
+	timer16_priv.mapcommon = base[REG_COMM];
 	timer16_priv.enb = 1 << ch;
 	timer16_priv.imfa = 1 << ch;
 	timer16_priv.imiea = 1 << (4 + ch);
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 187c416..aa4b2a98 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -30,7 +30,7 @@
 
 struct timer8_priv {
 	struct clock_event_device ced;
-	unsigned long mapbase;
+	void __iomem *mapbase;
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
@@ -41,15 +41,15 @@ static unsigned long timer8_get_counter(struct timer8_priv *p)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapbase + _8TCSR) & 0x20;
+	o1 = readb(p->mapbase + _8TCSR) & 0x20;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = ctrl_inw(p->mapbase + _8TCNT);
-		v2 = ctrl_inw(p->mapbase + _8TCNT);
-		v3 = ctrl_inw(p->mapbase + _8TCNT);
-		o1 = ctrl_inb(p->mapbase + _8TCSR) & 0x20;
+		v1 = readw(p->mapbase + _8TCNT);
+		v2 = readw(p->mapbase + _8TCNT);
+		v3 = readw(p->mapbase + _8TCNT);
+		o1 = readb(p->mapbase + _8TCSR) & 0x20;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -61,13 +61,13 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 {
 	struct timer8_priv *p = dev_id;
 
-	ctrl_outb(ctrl_inb(p->mapbase + _8TCSR) & ~0x40,
+	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
 		  p->mapbase + _8TCSR);
 
-	ctrl_outw(p->tcora, p->mapbase + TCORA);
+	writew(p->tcora, p->mapbase + TCORA);
 
 	if (clockevent_state_oneshot(&p->ced))
-		ctrl_outw(0x0000, p->mapbase + _8TCR);
+		writew(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
@@ -82,18 +82,18 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
 	p->tcora = delta;
-	ctrl_outb(ctrl_inb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
+	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
 	if (delta > now)
-		ctrl_outw(delta, p->mapbase + TCORA);
+		writew(delta, p->mapbase + TCORA);
 	else
-		ctrl_outw(now + 1, p->mapbase + TCORA);
+		writew(now + 1, p->mapbase + TCORA);
 }
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	ctrl_outw(0xffff, p->mapbase + TCORA);
-	ctrl_outw(0x0000, p->mapbase + _8TCNT);
-	ctrl_outw(0x0c02, p->mapbase + _8TCR);
+	writew(0xffff, p->mapbase + TCORA);
+	writew(0x0000, p->mapbase + _8TCNT);
+	writew(0x0c02, p->mapbase + _8TCR);
 
 	return 0;
 }
@@ -114,7 +114,7 @@ static int timer8_start(struct timer8_priv *p)
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	ctrl_outw(0x0000, p->mapbase + _8TCR);
+	writew(0x0000, p->mapbase + _8TCR);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
@@ -213,7 +213,7 @@ static void __init h8300_8timer_init(struct device_node *node)
 		goto unmap_reg;
 	}
 
-	timer8_priv.mapbase = (unsigned long)base;
+	timer8_priv.mapbase = base;
 
 	rate = clk_get_rate(clk) / SCALE;
 	if (!rate) {
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index c1eef42..91bf1992 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -21,8 +21,8 @@
 
 struct tpu_priv {
 	struct clocksource cs;
-	unsigned long mapbase1;
-	unsigned long mapbase2;
+	void __iomem *mapbase1;
+	void __iomem *mapbase2;
 	raw_spinlock_t lock;
 	unsigned int cs_enabled;
 };
@@ -31,8 +31,8 @@ static inline unsigned long read_tcnt32(struct tpu_priv *p)
 {
 	unsigned long tcnt;
 
-	tcnt = ctrl_inw(p->mapbase1 + TCNT) << 16;
-	tcnt |= ctrl_inw(p->mapbase2 + TCNT);
+	tcnt = readw(p->mapbase1 + TCNT) << 16;
+	tcnt |= readw(p->mapbase2 + TCNT);
 	return tcnt;
 }
 
@@ -41,7 +41,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapbase1 + TSR) & 0x10;
+	o1 = readb(p->mapbase1 + TSR) & 0x10;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
@@ -49,7 +49,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 		v1 = read_tcnt32(p);
 		v2 = read_tcnt32(p);
 		v3 = read_tcnt32(p);
-		o1 = ctrl_inb(p->mapbase1 + TSR) & 0x10;
+		o1 = readb(p->mapbase1 + TSR) & 0x10;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -82,10 +82,10 @@ static int tpu_clocksource_enable(struct clocksource *cs)
 
 	WARN_ON(p->cs_enabled);
 
-	ctrl_outw(0, p->mapbase1 + TCNT);
-	ctrl_outw(0, p->mapbase2 + TCNT);
-	ctrl_outb(0x0f, p->mapbase1 + TCR);
-	ctrl_outb(0x03, p->mapbase2 + TCR);
+	writew(0, p->mapbase1 + TCNT);
+	writew(0, p->mapbase2 + TCNT);
+	writeb(0x0f, p->mapbase1 + TCR);
+	writeb(0x03, p->mapbase2 + TCR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -97,8 +97,8 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	ctrl_outb(0, p->mapbase1 + TCR);
-	ctrl_outb(0, p->mapbase2 + TCR);
+	writeb(0, p->mapbase1 + TCR);
+	writeb(0, p->mapbase2 + TCR);
 	p->cs_enabled = false;
 }
 
@@ -139,8 +139,8 @@ static void __init h8300_tpu_init(struct device_node *node)
 		goto unmap_L;
 	}
 
-	tpu_priv.mapbase1 = (unsigned long)base[CH_L];
-	tpu_priv.mapbase2 = (unsigned long)base[CH_H];
+	tpu_priv.mapbase1 = base[CH_L];
+	tpu_priv.mapbase2 = base[CH_H];
 
 	clocksource_register_hz(&tpu_priv.cs, clk_get_rate(clk) / 64);
 
diff --git a/drivers/irqchip/irq-renesas-h8300h.c b/drivers/irqchip/irq-renesas-h8300h.c
index 6fd30d5..c378768 100644
--- a/drivers/irqchip/irq-renesas-h8300h.c
+++ b/drivers/irqchip/irq-renesas-h8300h.c
@@ -21,9 +21,9 @@ static const char ipr_bit[] = {
 	10, 10, 10, 10,  9,  9,  9,  9,
 };
 
-static void *intc_baseaddr;
+static void __iomem *intc_baseaddr;
 
-#define IPR ((unsigned long)intc_baseaddr + 6)
+#define IPR (intc_baseaddr + 6)
 
 static void h8300h_disable_irq(struct irq_data *data)
 {
@@ -81,8 +81,8 @@ static int __init h8300h_intc_of_init(struct device_node *intc,
 	BUG_ON(!intc_baseaddr);
 
 	/* All interrupt priority low */
-	ctrl_outb(0x00, IPR + 0);
-	ctrl_outb(0x00, IPR + 1);
+	writeb(0x00, IPR + 0);
+	writeb(0x00, IPR + 1);
 
 	domain = irq_domain_add_linear(intc, NR_IRQS, &irq_ops, NULL);
 	BUG_ON(!domain);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 55/69] h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

For the sake of consistency, let rename all ctrl_out/in calls to the write/read
calls so we have the same API consistent with the other architectures hence
open the door for the increasing of the test compilation coverage.

The unsigned long coercive cast is removed because all variables are set to
the right type "void __iomem *".

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/h8300/include/asm/io.h          | 39 +++++++++++++++++++++---------------
 arch/h8300/kernel/setup.c            |  8 ++++----
 drivers/clocksource/h8300_timer16.c  | 28 +++++++++++++-------------
 drivers/clocksource/h8300_timer8.c   | 34 +++++++++++++++----------------
 drivers/clocksource/h8300_tpu.c      | 28 +++++++++++++-------------
 drivers/irqchip/irq-renesas-h8300h.c |  8 ++++----
 6 files changed, 76 insertions(+), 69 deletions(-)

diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h
index bb837cd..f0e14f3 100644
--- a/arch/h8300/include/asm/io.h
+++ b/arch/h8300/include/asm/io.h
@@ -3,40 +3,45 @@
 
 #ifdef __KERNEL__
 
-#include <asm-generic/io.h>
-
 /* H8/300 internal I/O functions */
-static inline unsigned char ctrl_inb(unsigned long addr)
+
+#define __raw_readb __raw_readb
+static inline u8 __raw_readb(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned char *)addr;
+	return *(volatile u8 *)addr;
 }
 
-static inline unsigned short ctrl_inw(unsigned long addr)
+#define __raw_readw __raw_readw
+static inline u16 __raw_readw(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned short *)addr;
+	return *(volatile u16 *)addr;
 }
 
-static inline unsigned long ctrl_inl(unsigned long addr)
+#define __raw_readl __raw_readl
+static inline u32  __raw_readl(const volatile void __iomem *addr)
 {
-	return *(volatile unsigned long *)addr;
+	return *(volatile u32 *)addr;
 }
 
-static inline void ctrl_outb(unsigned char b, unsigned long addr)
+#define __raw_writeb __raw_writeb
+static inline void __raw_writeb(u8 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned char *)addr = b;
+	*(volatile u8 *)addr = b;
 }
 
-static inline void ctrl_outw(unsigned short b, unsigned long addr)
+#define __raw_writew __raw_writew
+static inline void __raw_writew(u16 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned short *)addr = b;
+	*(volatile u16 *)addr = b;
 }
 
-static inline void ctrl_outl(unsigned long b, unsigned long addr)
+#define __raw_writel __raw_writel
+static inline void __raw_writel(u32 b, const volatile void __iomem *addr)
 {
-	*(volatile unsigned long *)addr = b;
+	*(volatile u32 *)addr = b;
 }
 
-static inline void ctrl_bclr(int b, unsigned char *addr)
+static inline void ctrl_bclr(int b, void __iomem *addr)
 {
 	if (__builtin_constant_p(b))
 		__asm__("bclr %1,%0" : "+WU"(*addr): "i"(b));
@@ -44,7 +49,7 @@ static inline void ctrl_bclr(int b, unsigned char *addr)
 		__asm__("bclr %w1,%0" : "+WU"(*addr): "r"(b));
 }
 
-static inline void ctrl_bset(int b, unsigned char *addr)
+static inline void ctrl_bset(int b, void __iomem *addr)
 {
 	if (__builtin_constant_p(b))
 		__asm__("bset %1,%0" : "+WU"(*addr): "i"(b));
@@ -52,6 +57,8 @@ static inline void ctrl_bset(int b, unsigned char *addr)
 		__asm__("bset %w1,%0" : "+WU"(*addr): "r"(b));
 }
 
+#include <asm-generic/io.h>
+
 #endif /* __KERNEL__ */
 
 #endif /* _H8300_IO_H */
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index c772abe..e4985df 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -207,14 +207,14 @@ device_initcall(device_probe);
 #define get_wait(base, addr) ({		\
 	int baddr;			\
 	baddr = ((addr) / 0x200000 * 2);			     \
-	w *= (ctrl_inw((unsigned long)(base) + 2) & (3 << baddr)) + 1;	\
+	w *= (readw((base) + 2) & (3 << baddr)) + 1;		     \
 	})
 #endif
 #if defined(CONFIG_CPU_H8S)
 #define get_wait(base, addr) ({		\
 	int baddr;			\
 	baddr = ((addr) / 0x200000 * 16);			     \
-	w *= (ctrl_inl((unsigned long)(base) + 2) & (7 << baddr)) + 1;	\
+	w *= (readl((base) + 2) & (7 << baddr)) + 1;	\
 	})
 #endif
 
@@ -228,8 +228,8 @@ static __init int access_timing(void)
 
 	bsc = of_find_compatible_node(NULL, NULL, "renesas,h8300-bsc");
 	base = of_iomap(bsc, 0);
-	w = (ctrl_inb((unsigned long)base + 0) & bit)?2:1;
-	if (ctrl_inb((unsigned long)base + 1) & bit)
+	w = (readb(base + 0) & bit)?2:1;
+	if (readb(base + 1) & bit)
 		w *= get_wait(base, addr);
 	else
 		w *= 2;
diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index f396605..fc14a3f 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -23,8 +23,8 @@
 struct timer16_priv {
 	struct clocksource cs;
 	unsigned long total_cycles;
-	unsigned long mapbase;
-	unsigned long mapcommon;
+	void __iomem *mapbase;
+	void __iomem *mapcommon;
 	unsigned short cs_enabled;
 	unsigned char enb;
 	unsigned char imfa;
@@ -38,15 +38,15 @@ static unsigned long timer16_get_counter(struct timer16_priv *p)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapcommon + TISRC) & p->ovf;
+	o1 = readb(p->mapcommon + TISRC) & p->ovf;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = ctrl_inw(p->mapbase + TCNT);
-		v2 = ctrl_inw(p->mapbase + TCNT);
-		v3 = ctrl_inw(p->mapbase + TCNT);
-		o1 = ctrl_inb(p->mapcommon + TISRC) & p->ovf;
+		v1 = readw(p->mapbase + TCNT);
+		v2 = readw(p->mapbase + TCNT);
+		v3 = readw(p->mapbase + TCNT);
+		o1 = readb(p->mapcommon + TISRC) & p->ovf;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -59,7 +59,7 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	ctrl_outb(ctrl_inb(p->mapcommon + TISRA) & ~p->imfa,
+	writeb(readb(p->mapcommon + TISRA) & ~p->imfa,
 		  p->mapcommon + TISRA);
 	p->total_cycles += 0x10000;
 
@@ -89,9 +89,9 @@ static int timer16_enable(struct clocksource *cs)
 	WARN_ON(p->cs_enabled);
 
 	p->total_cycles = 0;
-	ctrl_outw(0x0000, p->mapbase + TCNT);
-	ctrl_outb(0x83, p->mapbase + TCR);
-	ctrl_outb(ctrl_inb(p->mapcommon + TSTR) | p->enb,
+	writew(0x0000, p->mapbase + TCNT);
+	writeb(0x83, p->mapbase + TCR);
+	writeb(readb(p->mapcommon + TSTR) | p->enb,
 		  p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
@@ -104,7 +104,7 @@ static void timer16_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	ctrl_outb(ctrl_inb(p->mapcommon + TSTR) & ~p->enb,
+	writeb(readb(p->mapcommon + TSTR) & ~p->enb,
 		  p->mapcommon + TSTR);
 
 	p->cs_enabled = false;
@@ -158,8 +158,8 @@ static void __init h8300_16timer_init(struct device_node *node)
 
 	of_property_read_u32(node, "renesas,channel", &ch);
 
-	timer16_priv.mapbase = (unsigned long)base[REG_CH];
-	timer16_priv.mapcommon = (unsigned long)base[REG_COMM];
+	timer16_priv.mapbase = base[REG_CH];
+	timer16_priv.mapcommon = base[REG_COMM];
 	timer16_priv.enb = 1 << ch;
 	timer16_priv.imfa = 1 << ch;
 	timer16_priv.imiea = 1 << (4 + ch);
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 187c416..aa4b2a98 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -30,7 +30,7 @@
 
 struct timer8_priv {
 	struct clock_event_device ced;
-	unsigned long mapbase;
+	void __iomem *mapbase;
 	unsigned long flags;
 	unsigned int rate;
 	unsigned int tcora;
@@ -41,15 +41,15 @@ static unsigned long timer8_get_counter(struct timer8_priv *p)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapbase + _8TCSR) & 0x20;
+	o1 = readb(p->mapbase + _8TCSR) & 0x20;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = ctrl_inw(p->mapbase + _8TCNT);
-		v2 = ctrl_inw(p->mapbase + _8TCNT);
-		v3 = ctrl_inw(p->mapbase + _8TCNT);
-		o1 = ctrl_inb(p->mapbase + _8TCSR) & 0x20;
+		v1 = readw(p->mapbase + _8TCNT);
+		v2 = readw(p->mapbase + _8TCNT);
+		v3 = readw(p->mapbase + _8TCNT);
+		o1 = readb(p->mapbase + _8TCSR) & 0x20;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -61,13 +61,13 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 {
 	struct timer8_priv *p = dev_id;
 
-	ctrl_outb(ctrl_inb(p->mapbase + _8TCSR) & ~0x40,
+	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
 		  p->mapbase + _8TCSR);
 
-	ctrl_outw(p->tcora, p->mapbase + TCORA);
+	writew(p->tcora, p->mapbase + TCORA);
 
 	if (clockevent_state_oneshot(&p->ced))
-		ctrl_outw(0x0000, p->mapbase + _8TCR);
+		writew(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
@@ -82,18 +82,18 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 		pr_warn("delta out of range\n");
 	now = timer8_get_counter(p);
 	p->tcora = delta;
-	ctrl_outb(ctrl_inb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
+	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
 	if (delta > now)
-		ctrl_outw(delta, p->mapbase + TCORA);
+		writew(delta, p->mapbase + TCORA);
 	else
-		ctrl_outw(now + 1, p->mapbase + TCORA);
+		writew(now + 1, p->mapbase + TCORA);
 }
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	ctrl_outw(0xffff, p->mapbase + TCORA);
-	ctrl_outw(0x0000, p->mapbase + _8TCNT);
-	ctrl_outw(0x0c02, p->mapbase + _8TCR);
+	writew(0xffff, p->mapbase + TCORA);
+	writew(0x0000, p->mapbase + _8TCNT);
+	writew(0x0c02, p->mapbase + _8TCR);
 
 	return 0;
 }
@@ -114,7 +114,7 @@ static int timer8_start(struct timer8_priv *p)
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	ctrl_outw(0x0000, p->mapbase + _8TCR);
+	writew(0x0000, p->mapbase + _8TCR);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
@@ -213,7 +213,7 @@ static void __init h8300_8timer_init(struct device_node *node)
 		goto unmap_reg;
 	}
 
-	timer8_priv.mapbase = (unsigned long)base;
+	timer8_priv.mapbase = base;
 
 	rate = clk_get_rate(clk) / SCALE;
 	if (!rate) {
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index c1eef42..91bf1992 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -21,8 +21,8 @@
 
 struct tpu_priv {
 	struct clocksource cs;
-	unsigned long mapbase1;
-	unsigned long mapbase2;
+	void __iomem *mapbase1;
+	void __iomem *mapbase2;
 	raw_spinlock_t lock;
 	unsigned int cs_enabled;
 };
@@ -31,8 +31,8 @@ static inline unsigned long read_tcnt32(struct tpu_priv *p)
 {
 	unsigned long tcnt;
 
-	tcnt = ctrl_inw(p->mapbase1 + TCNT) << 16;
-	tcnt |= ctrl_inw(p->mapbase2 + TCNT);
+	tcnt = readw(p->mapbase1 + TCNT) << 16;
+	tcnt |= readw(p->mapbase2 + TCNT);
 	return tcnt;
 }
 
@@ -41,7 +41,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = ctrl_inb(p->mapbase1 + TSR) & 0x10;
+	o1 = readb(p->mapbase1 + TSR) & 0x10;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
@@ -49,7 +49,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 		v1 = read_tcnt32(p);
 		v2 = read_tcnt32(p);
 		v3 = read_tcnt32(p);
-		o1 = ctrl_inb(p->mapbase1 + TSR) & 0x10;
+		o1 = readb(p->mapbase1 + TSR) & 0x10;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -82,10 +82,10 @@ static int tpu_clocksource_enable(struct clocksource *cs)
 
 	WARN_ON(p->cs_enabled);
 
-	ctrl_outw(0, p->mapbase1 + TCNT);
-	ctrl_outw(0, p->mapbase2 + TCNT);
-	ctrl_outb(0x0f, p->mapbase1 + TCR);
-	ctrl_outb(0x03, p->mapbase2 + TCR);
+	writew(0, p->mapbase1 + TCNT);
+	writew(0, p->mapbase2 + TCNT);
+	writeb(0x0f, p->mapbase1 + TCR);
+	writeb(0x03, p->mapbase2 + TCR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -97,8 +97,8 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	ctrl_outb(0, p->mapbase1 + TCR);
-	ctrl_outb(0, p->mapbase2 + TCR);
+	writeb(0, p->mapbase1 + TCR);
+	writeb(0, p->mapbase2 + TCR);
 	p->cs_enabled = false;
 }
 
@@ -139,8 +139,8 @@ static void __init h8300_tpu_init(struct device_node *node)
 		goto unmap_L;
 	}
 
-	tpu_priv.mapbase1 = (unsigned long)base[CH_L];
-	tpu_priv.mapbase2 = (unsigned long)base[CH_H];
+	tpu_priv.mapbase1 = base[CH_L];
+	tpu_priv.mapbase2 = base[CH_H];
 
 	clocksource_register_hz(&tpu_priv.cs, clk_get_rate(clk) / 64);
 
diff --git a/drivers/irqchip/irq-renesas-h8300h.c b/drivers/irqchip/irq-renesas-h8300h.c
index 6fd30d5..c378768 100644
--- a/drivers/irqchip/irq-renesas-h8300h.c
+++ b/drivers/irqchip/irq-renesas-h8300h.c
@@ -21,9 +21,9 @@ static const char ipr_bit[] = {
 	10, 10, 10, 10,  9,  9,  9,  9,
 };
 
-static void *intc_baseaddr;
+static void __iomem *intc_baseaddr;
 
-#define IPR ((unsigned long)intc_baseaddr + 6)
+#define IPR (intc_baseaddr + 6)
 
 static void h8300h_disable_irq(struct irq_data *data)
 {
@@ -81,8 +81,8 @@ static int __init h8300h_intc_of_init(struct device_node *intc,
 	BUG_ON(!intc_baseaddr);
 
 	/* All interrupt priority low */
-	ctrl_outb(0x00, IPR + 0);
-	ctrl_outb(0x00, IPR + 1);
+	writeb(0x00, IPR + 0);
+	writeb(0x00, IPR + 1);
 
 	domain = irq_domain_add_linear(intc, NR_IRQS, &irq_ops, NULL);
 	BUG_ON(!domain);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 56/69] clocksource/drivers/h8300: Increase the compilation test coverage
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

Add the COMPILE_TEST option so the drivers can be compiled on different
architecture with the 'allyesconfig' kernel configuration.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 73477b5..db240cb 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -363,13 +363,24 @@ config CLKSRC_PXA
 	  platforms.
 
 config H8300_TMR8
-        bool
+        bool "Clockevent timer for the H8300 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the 8 bits timer for the H8300 platform.
 
 config H8300_TMR16
-        bool
+        bool "Clockevent timer for the H83069 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the 16 bits timer for the H8300 platform with the
+	  H83069 cpu.
 
 config H8300_TPU
-        bool
+        bool "Clocksource for the H8300 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the clocksource for the H8300 platform with the
+	  H8S2678 cpu.
 
 config CLKSRC_IMX_GPT
 	bool "Clocksource using i.MX GPT" if COMPILE_TEST
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 56/69] clocksource/drivers/h8300: Increase the compilation test coverage
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

Add the COMPILE_TEST option so the drivers can be compiled on different
architecture with the 'allyesconfig' kernel configuration.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 73477b5..db240cb 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -363,13 +363,24 @@ config CLKSRC_PXA
 	  platforms.
 
 config H8300_TMR8
-        bool
+        bool "Clockevent timer for the H8300 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the 8 bits timer for the H8300 platform.
 
 config H8300_TMR16
-        bool
+        bool "Clockevent timer for the H83069 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the 16 bits timer for the H8300 platform with the
+	  H83069 cpu.
 
 config H8300_TPU
-        bool
+        bool "Clocksource for the H8300 platform" if COMPILE_TEST
+        depends on GENERIC_CLOCKEVENTS
+	help
+	  This enables the clocksource for the H8300 platform with the
+	  H8S2678 cpu.
 
 config CLKSRC_IMX_GPT
 	bool "Clocksource using i.MX GPT" if COMPILE_TEST
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 57/69] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo

The current code to initialize, register and read the clocksource is
already factored out in mmio.c via the clocksource_mmio_init function.

Factor out the code with the clocksource_mmio_init function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig      |  1 +
 drivers/clocksource/tango_xtal.c | 18 +++---------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index db240cb..b251013 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -351,6 +351,7 @@ config CLKSRC_TANGO_XTAL
 	bool "Clocksource for Tango SoC" if COMPILE_TEST
 	depends on ARM
 	select CLKSRC_OF
+	select CLKSRC_MMIO
 	help
 	  This enables the clocksource for Tango SoC
 
diff --git a/drivers/clocksource/tango_xtal.c b/drivers/clocksource/tango_xtal.c
index d297b30..2bcecaf 100644
--- a/drivers/clocksource/tango_xtal.c
+++ b/drivers/clocksource/tango_xtal.c
@@ -19,19 +19,6 @@ static u64 notrace read_sched_clock(void)
 	return read_xtal_counter();
 }
 
-static cycle_t read_clocksource(struct clocksource *cs)
-{
-	return read_xtal_counter();
-}
-
-static struct clocksource tango_xtal = {
-	.name	= "tango-xtal",
-	.rating	= 350,
-	.read	= read_clocksource,
-	.mask	= CLOCKSOURCE_MASK(32),
-	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
 static void __init tango_clocksource_init(struct device_node *np)
 {
 	struct clk *clk;
@@ -53,8 +40,9 @@ static void __init tango_clocksource_init(struct device_node *np)
 	delay_timer.freq = xtal_freq;
 	delay_timer.read_current_timer = read_xtal_counter;
 
-	ret = clocksource_register_hz(&tango_xtal, xtal_freq);
-	if (ret != 0) {
+	ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350,
+				    32, clocksource_mmio_readl_up);
+	if (!ret) {
 		pr_err("%s: registration failed\n", np->full_name);
 		return;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 57/69] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

The current code to initialize, register and read the clocksource is
already factored out in mmio.c via the clocksource_mmio_init function.

Factor out the code with the clocksource_mmio_init function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig      |  1 +
 drivers/clocksource/tango_xtal.c | 18 +++---------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index db240cb..b251013 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -351,6 +351,7 @@ config CLKSRC_TANGO_XTAL
 	bool "Clocksource for Tango SoC" if COMPILE_TEST
 	depends on ARM
 	select CLKSRC_OF
+	select CLKSRC_MMIO
 	help
 	  This enables the clocksource for Tango SoC
 
diff --git a/drivers/clocksource/tango_xtal.c b/drivers/clocksource/tango_xtal.c
index d297b30..2bcecaf 100644
--- a/drivers/clocksource/tango_xtal.c
+++ b/drivers/clocksource/tango_xtal.c
@@ -19,19 +19,6 @@ static u64 notrace read_sched_clock(void)
 	return read_xtal_counter();
 }
 
-static cycle_t read_clocksource(struct clocksource *cs)
-{
-	return read_xtal_counter();
-}
-
-static struct clocksource tango_xtal = {
-	.name	= "tango-xtal",
-	.rating	= 350,
-	.read	= read_clocksource,
-	.mask	= CLOCKSOURCE_MASK(32),
-	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
 static void __init tango_clocksource_init(struct device_node *np)
 {
 	struct clk *clk;
@@ -53,8 +40,9 @@ static void __init tango_clocksource_init(struct device_node *np)
 	delay_timer.freq = xtal_freq;
 	delay_timer.read_current_timer = read_xtal_counter;
 
-	ret = clocksource_register_hz(&tango_xtal, xtal_freq);
-	if (ret != 0) {
+	ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350,
+				    32, clocksource_mmio_readl_up);
+	if (!ret) {
 		pr_err("%s: registration failed\n", np->full_name);
 		return;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 58/69] clocksource/drivers/dw_apb_timer: Fix apbt_readl return types
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang

From: Jisheng Zhang <jszhang@marvell.com>

On Marvell BG4CT platform, we observed the __apbt_read_clocksource()
return wrong value: Let's assume the APBTMR_N_CURRENT_VALUE value is
0xf0000000, we got 0xffffffff0fffffff, but it should be 0xfffffff.

This issue should be common on all 64bit platforms. We fix the issue
by letting aptb_readl() return u32. apbt_writel() is also updated
to write u32 val rather than unsigned long.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index c76c750..3a6d9db 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -49,12 +49,12 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs)
 	return container_of(cs, struct dw_apb_clocksource, cs);
 }
 
-static unsigned long apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
+static u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
 {
 	return readl(timer->base + offs);
 }
 
-static void apbt_writel(struct dw_apb_timer *timer, unsigned long val,
+static void apbt_writel(struct dw_apb_timer *timer, u32 val,
 		 unsigned long offs)
 {
 	writel(val, timer->base + offs);
@@ -62,7 +62,7 @@ static void apbt_writel(struct dw_apb_timer *timer, unsigned long val,
 
 static void apbt_disable_int(struct dw_apb_timer *timer)
 {
-	unsigned long ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
 
 	ctrl |= APBTMR_CONTROL_INT;
 	apbt_writel(timer, ctrl, APBTMR_N_CONTROL);
@@ -103,7 +103,7 @@ static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
 
 static void apbt_enable_int(struct dw_apb_timer *timer)
 {
-	unsigned long ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
 	/* clear pending intr */
 	apbt_readl(timer, APBTMR_N_EOI);
 	ctrl &= ~APBTMR_CONTROL_INT;
@@ -113,7 +113,7 @@ static void apbt_enable_int(struct dw_apb_timer *timer)
 static int apbt_shutdown(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=shutdown\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -127,7 +127,7 @@ static int apbt_shutdown(struct clock_event_device *evt)
 static int apbt_set_oneshot(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=oneshot\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -160,7 +160,7 @@ static int apbt_set_periodic(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 	unsigned long period = DIV_ROUND_UP(dw_ced->timer.freq, HZ);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=periodic\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -196,7 +196,7 @@ static int apbt_resume(struct clock_event_device *evt)
 static int apbt_next_event(unsigned long delta,
 			   struct clock_event_device *evt)
 {
-	unsigned long ctrl;
+	u32 ctrl;
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 
 	/* Disable timer */
@@ -323,7 +323,7 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs)
 	 * start count down from 0xffff_ffff. this is done by toggling the
 	 * enable bit then load initial load count to ~0.
 	 */
-	unsigned long ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL);
 
 	ctrl &= ~APBTMR_CONTROL_ENABLE;
 	apbt_writel(&dw_cs->timer, ctrl, APBTMR_N_CONTROL);
@@ -338,7 +338,7 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs)
 
 static cycle_t __apbt_read_clocksource(struct clocksource *cs)
 {
-	unsigned long current_count;
+	u32 current_count;
 	struct dw_apb_clocksource *dw_cs =
 		clocksource_to_dw_apb_clocksource(cs);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 58/69] clocksource/drivers/dw_apb_timer: Fix apbt_readl return types
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

On Marvell BG4CT platform, we observed the __apbt_read_clocksource()
return wrong value: Let's assume the APBTMR_N_CURRENT_VALUE value is
0xf0000000, we got 0xffffffff0fffffff, but it should be 0xfffffff.

This issue should be common on all 64bit platforms. We fix the issue
by letting aptb_readl() return u32. apbt_writel() is also updated
to write u32 val rather than unsigned long.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index c76c750..3a6d9db 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -49,12 +49,12 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs)
 	return container_of(cs, struct dw_apb_clocksource, cs);
 }
 
-static unsigned long apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
+static u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
 {
 	return readl(timer->base + offs);
 }
 
-static void apbt_writel(struct dw_apb_timer *timer, unsigned long val,
+static void apbt_writel(struct dw_apb_timer *timer, u32 val,
 		 unsigned long offs)
 {
 	writel(val, timer->base + offs);
@@ -62,7 +62,7 @@ static void apbt_writel(struct dw_apb_timer *timer, unsigned long val,
 
 static void apbt_disable_int(struct dw_apb_timer *timer)
 {
-	unsigned long ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
 
 	ctrl |= APBTMR_CONTROL_INT;
 	apbt_writel(timer, ctrl, APBTMR_N_CONTROL);
@@ -103,7 +103,7 @@ static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
 
 static void apbt_enable_int(struct dw_apb_timer *timer)
 {
-	unsigned long ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
 	/* clear pending intr */
 	apbt_readl(timer, APBTMR_N_EOI);
 	ctrl &= ~APBTMR_CONTROL_INT;
@@ -113,7 +113,7 @@ static void apbt_enable_int(struct dw_apb_timer *timer)
 static int apbt_shutdown(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=shutdown\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -127,7 +127,7 @@ static int apbt_shutdown(struct clock_event_device *evt)
 static int apbt_set_oneshot(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=oneshot\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -160,7 +160,7 @@ static int apbt_set_periodic(struct clock_event_device *evt)
 {
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 	unsigned long period = DIV_ROUND_UP(dw_ced->timer.freq, HZ);
-	unsigned long ctrl;
+	u32 ctrl;
 
 	pr_debug("%s CPU %d state=periodic\n", __func__,
 		 cpumask_first(evt->cpumask));
@@ -196,7 +196,7 @@ static int apbt_resume(struct clock_event_device *evt)
 static int apbt_next_event(unsigned long delta,
 			   struct clock_event_device *evt)
 {
-	unsigned long ctrl;
+	u32 ctrl;
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 
 	/* Disable timer */
@@ -323,7 +323,7 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs)
 	 * start count down from 0xffff_ffff. this is done by toggling the
 	 * enable bit then load initial load count to ~0.
 	 */
-	unsigned long ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL);
+	u32 ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL);
 
 	ctrl &= ~APBTMR_CONTROL_ENABLE;
 	apbt_writel(&dw_cs->timer, ctrl, APBTMR_N_CONTROL);
@@ -338,7 +338,7 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs)
 
 static cycle_t __apbt_read_clocksource(struct clocksource *cs)
 {
-	unsigned long current_count;
+	u32 current_count;
 	struct dw_apb_clocksource *dw_cs =
 		clocksource_to_dw_apb_clocksource(cs);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 59/69] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical path
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang

From: Jisheng Zhang <jszhang@marvell.com>

It's safe to use the relaxed version. From another side, the relaxed io
accessor macros are available on all architectures now, so we can use
the relaxed versions to get a trivial system performance improvement,
we measured time the following functions spent on Marvell BG4CT:

4096 rounds of __apbt_read_clocksource() call:

before the patch: 1263240ns on average
after the patch: 1250080ns on average
improved by 1%

4096 rounds of apbt_eoi() call:

before the patch: 1290960ns on average
after the patch: 1248240ns on average

4096 rounds of apbt_next_event() call:

before the patch: 3333660ns on average
after the patch: 1322040ns on average

improved by 60%!

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 3a6d9db..7f95b53 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -60,6 +60,17 @@ static void apbt_writel(struct dw_apb_timer *timer, u32 val,
 	writel(val, timer->base + offs);
 }
 
+static inline u32 apbt_readl_relaxed(struct dw_apb_timer *timer, unsigned long offs)
+{
+	return readl_relaxed(timer->base + offs);
+}
+
+static inline void apbt_writel_relaxed(struct dw_apb_timer *timer, u32 val,
+			unsigned long offs)
+{
+	writel_relaxed(val, timer->base + offs);
+}
+
 static void apbt_disable_int(struct dw_apb_timer *timer)
 {
 	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
@@ -81,7 +92,7 @@ void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced)
 
 static void apbt_eoi(struct dw_apb_timer *timer)
 {
-	apbt_readl(timer, APBTMR_N_EOI);
+	apbt_readl_relaxed(timer, APBTMR_N_EOI);
 }
 
 static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
@@ -200,13 +211,13 @@ static int apbt_next_event(unsigned long delta,
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 
 	/* Disable timer */
-	ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
+	ctrl = apbt_readl_relaxed(&dw_ced->timer, APBTMR_N_CONTROL);
 	ctrl &= ~APBTMR_CONTROL_ENABLE;
-	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	apbt_writel_relaxed(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
 	/* write new count */
-	apbt_writel(&dw_ced->timer, delta, APBTMR_N_LOAD_COUNT);
+	apbt_writel_relaxed(&dw_ced->timer, delta, APBTMR_N_LOAD_COUNT);
 	ctrl |= APBTMR_CONTROL_ENABLE;
-	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	apbt_writel_relaxed(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
 
 	return 0;
 }
@@ -342,7 +353,8 @@ static cycle_t __apbt_read_clocksource(struct clocksource *cs)
 	struct dw_apb_clocksource *dw_cs =
 		clocksource_to_dw_apb_clocksource(cs);
 
-	current_count = apbt_readl(&dw_cs->timer, APBTMR_N_CURRENT_VALUE);
+	current_count = apbt_readl_relaxed(&dw_cs->timer,
+					APBTMR_N_CURRENT_VALUE);
 
 	return (cycle_t)~current_count;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 59/69] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical path
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

It's safe to use the relaxed version. From another side, the relaxed io
accessor macros are available on all architectures now, so we can use
the relaxed versions to get a trivial system performance improvement,
we measured time the following functions spent on Marvell BG4CT:

4096 rounds of __apbt_read_clocksource() call:

before the patch: 1263240ns on average
after the patch: 1250080ns on average
improved by 1%

4096 rounds of apbt_eoi() call:

before the patch: 1290960ns on average
after the patch: 1248240ns on average

4096 rounds of apbt_next_event() call:

before the patch: 3333660ns on average
after the patch: 1322040ns on average

improved by 60%!

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 3a6d9db..7f95b53 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -60,6 +60,17 @@ static void apbt_writel(struct dw_apb_timer *timer, u32 val,
 	writel(val, timer->base + offs);
 }
 
+static inline u32 apbt_readl_relaxed(struct dw_apb_timer *timer, unsigned long offs)
+{
+	return readl_relaxed(timer->base + offs);
+}
+
+static inline void apbt_writel_relaxed(struct dw_apb_timer *timer, u32 val,
+			unsigned long offs)
+{
+	writel_relaxed(val, timer->base + offs);
+}
+
 static void apbt_disable_int(struct dw_apb_timer *timer)
 {
 	u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
@@ -81,7 +92,7 @@ void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced)
 
 static void apbt_eoi(struct dw_apb_timer *timer)
 {
-	apbt_readl(timer, APBTMR_N_EOI);
+	apbt_readl_relaxed(timer, APBTMR_N_EOI);
 }
 
 static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
@@ -200,13 +211,13 @@ static int apbt_next_event(unsigned long delta,
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 
 	/* Disable timer */
-	ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
+	ctrl = apbt_readl_relaxed(&dw_ced->timer, APBTMR_N_CONTROL);
 	ctrl &= ~APBTMR_CONTROL_ENABLE;
-	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	apbt_writel_relaxed(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
 	/* write new count */
-	apbt_writel(&dw_ced->timer, delta, APBTMR_N_LOAD_COUNT);
+	apbt_writel_relaxed(&dw_ced->timer, delta, APBTMR_N_LOAD_COUNT);
 	ctrl |= APBTMR_CONTROL_ENABLE;
-	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	apbt_writel_relaxed(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
 
 	return 0;
 }
@@ -342,7 +353,8 @@ static cycle_t __apbt_read_clocksource(struct clocksource *cs)
 	struct dw_apb_clocksource *dw_cs =
 		clocksource_to_dw_apb_clocksource(cs);
 
-	current_count = apbt_readl(&dw_cs->timer, APBTMR_N_CURRENT_VALUE);
+	current_count = apbt_readl_relaxed(&dw_cs->timer,
+					APBTMR_N_CURRENT_VALUE);
 
 	return (cycle_t)~current_count;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 60/69] clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang

From: Jisheng Zhang <jszhang@marvell.com>

It seems gcc can automatically inline apbt_writel() for us, but
apbt_real isn't inlined. This patch makes them inline to get a trivial
performance improvement: 4096 rounds of __apbt_read_clocksource() call
spend time on Marvell BG4CT platform:

 before the patch 1275240ns on average
 after the patch 1263240ns on average

so we get 1% performance improvement.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 7f95b53..6334526 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -49,13 +49,13 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs)
 	return container_of(cs, struct dw_apb_clocksource, cs);
 }
 
-static u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
+static inline u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
 {
 	return readl(timer->base + offs);
 }
 
-static void apbt_writel(struct dw_apb_timer *timer, u32 val,
-		 unsigned long offs)
+static inline void apbt_writel(struct dw_apb_timer *timer, u32 val,
+			unsigned long offs)
 {
 	writel(val, timer->base + offs);
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 60/69] clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

It seems gcc can automatically inline apbt_writel() for us, but
apbt_real isn't inlined. This patch makes them inline to get a trivial
performance improvement: 4096 rounds of __apbt_read_clocksource() call
spend time on Marvell BG4CT platform:

 before the patch 1275240ns on average
 after the patch 1263240ns on average

so we get 1% performance improvement.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 7f95b53..6334526 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -49,13 +49,13 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs)
 	return container_of(cs, struct dw_apb_clocksource, cs);
 }
 
-static u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
+static inline u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
 {
 	return readl(timer->base + offs);
 }
 
-static void apbt_writel(struct dw_apb_timer *timer, u32 val,
-		 unsigned long offs)
+static inline void apbt_writel(struct dw_apb_timer *timer, u32 val,
+			unsigned long offs)
 {
 	writel(val, timer->base + offs);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 61/69] clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_set
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang,
	Srinivas Kandagatla, Maxime Coquelin, Patrice Chotard,
	open list:ARM/STI ARCHITECTURE

From: Jisheng Zhang <jszhang@marvell.com>

Use the relaxed version to improve performance. we measured time of
4096 rounds of gt_compare_set() spent on Marvell BG2Q:

before the patch: 3690648ns on average
after the patch: 1083023ns on average

improved by 70%!

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/arm_global_timer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index a2cb6fa..f99be6b 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -99,17 +99,17 @@ static void gt_compare_set(unsigned long delta, int periodic)
 
 	counter += delta;
 	ctrl = GT_CONTROL_TIMER_ENABLE;
-	writel(ctrl, gt_base + GT_CONTROL);
-	writel(lower_32_bits(counter), gt_base + GT_COMP0);
-	writel(upper_32_bits(counter), gt_base + GT_COMP1);
+	writel_relaxed(ctrl, gt_base + GT_CONTROL);
+	writel_relaxed(lower_32_bits(counter), gt_base + GT_COMP0);
+	writel_relaxed(upper_32_bits(counter), gt_base + GT_COMP1);
 
 	if (periodic) {
-		writel(delta, gt_base + GT_AUTO_INC);
+		writel_relaxed(delta, gt_base + GT_AUTO_INC);
 		ctrl |= GT_CONTROL_AUTO_INC;
 	}
 
 	ctrl |= GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE;
-	writel(ctrl, gt_base + GT_CONTROL);
+	writel_relaxed(ctrl, gt_base + GT_CONTROL);
 }
 
 static int gt_clockevent_shutdown(struct clock_event_device *evt)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 61/69] clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_set
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

Use the relaxed version to improve performance. we measured time of
4096 rounds of gt_compare_set() spent on Marvell BG2Q:

before the patch: 3690648ns on average
after the patch: 1083023ns on average

improved by 70%!

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/arm_global_timer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index a2cb6fa..f99be6b 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -99,17 +99,17 @@ static void gt_compare_set(unsigned long delta, int periodic)
 
 	counter += delta;
 	ctrl = GT_CONTROL_TIMER_ENABLE;
-	writel(ctrl, gt_base + GT_CONTROL);
-	writel(lower_32_bits(counter), gt_base + GT_COMP0);
-	writel(upper_32_bits(counter), gt_base + GT_COMP1);
+	writel_relaxed(ctrl, gt_base + GT_CONTROL);
+	writel_relaxed(lower_32_bits(counter), gt_base + GT_COMP0);
+	writel_relaxed(upper_32_bits(counter), gt_base + GT_COMP1);
 
 	if (periodic) {
-		writel(delta, gt_base + GT_AUTO_INC);
+		writel_relaxed(delta, gt_base + GT_AUTO_INC);
 		ctrl |= GT_CONTROL_AUTO_INC;
 	}
 
 	ctrl |= GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE;
-	writel(ctrl, gt_base + GT_CONTROL);
+	writel_relaxed(ctrl, gt_base + GT_CONTROL);
 }
 
 static int gt_clockevent_shutdown(struct clock_event_device *evt)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 62/69] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, linux-arm-kernel, mingo, Jisheng Zhang

From: Jisheng Zhang <jszhang@marvell.com>

Let's assume the counter value is 0xf0000000, the pistachio clocksource
read cycles function should return ~0x0fffffff but actually it returns
0xffffffff0fffffff.

That occurs because:

	~(cycle_t)value is different from (cycle_t)~value.

unsigned long val = ~(unsigned long)0xf0000000;
40049a:       48 b8 ff ff ff 0f ff    movabs $0xffffffff0fffffff,%rax

unsigned long val = (unsigned long)~0xf0000000;
40049a:       48 c7 45 f8 ff ff ff    movq   $0xfffffff,-0x8(%rbp)

We fix this issue by calculating bitwise-not counter, then cast to
cycle_t.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/time-pistachio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/time-pistachio.c b/drivers/clocksource/time-pistachio.c
index bba6799..3269d9e 100644
--- a/drivers/clocksource/time-pistachio.c
+++ b/drivers/clocksource/time-pistachio.c
@@ -84,7 +84,7 @@ pistachio_clocksource_read_cycles(struct clocksource *cs)
 	counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0);
 	raw_spin_unlock_irqrestore(&pcs->lock, flags);
 
-	return ~(cycle_t)counter;
+	return (cycle_t)~counter;
 }
 
 static u64 notrace pistachio_read_sched_clock(void)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 62/69] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jisheng Zhang <jszhang@marvell.com>

Let's assume the counter value is 0xf0000000, the pistachio clocksource
read cycles function should return ~0x0fffffff but actually it returns
0xffffffff0fffffff.

That occurs because:

	~(cycle_t)value is different from (cycle_t)~value.

unsigned long val = ~(unsigned long)0xf0000000;
40049a:       48 b8 ff ff ff 0f ff    movabs $0xffffffff0fffffff,%rax

unsigned long val = (unsigned long)~0xf0000000;
40049a:       48 c7 45 f8 ff ff ff    movq   $0xfffffff,-0x8(%rbp)

We fix this issue by calculating bitwise-not counter, then cast to
cycle_t.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/time-pistachio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/time-pistachio.c b/drivers/clocksource/time-pistachio.c
index bba6799..3269d9e 100644
--- a/drivers/clocksource/time-pistachio.c
+++ b/drivers/clocksource/time-pistachio.c
@@ -84,7 +84,7 @@ pistachio_clocksource_read_cycles(struct clocksource *cs)
 	counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0);
 	raw_spin_unlock_irqrestore(&pcs->lock, flags);
 
-	return ~(cycle_t)counter;
+	return (cycle_t)~counter;
 }
 
 static u64 notrace pistachio_read_sched_clock(void)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 63/69] clocksource/drivers/arm_global_timer: Fix suspend resume
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Grygorii Strashko,
	Arnd Bergmann, John Stultz, Felipe Balbi, Tony Lindgren,
	Marc Zyngier, Srinivas Kandagatla, Maxime Coquelin,
	Patrice Chotard, open list:ARM/STI ARCHITECTURE

From: Grygorii Strashko <grygorii.strashko@ti.com>

Now the System stall is observed on TI AM437x based board (am437x-gp-evm)
during resuming from System suspend when ARM Global timer is selected as
clocksource device (CPUIdle not enabled) - SysRq are working, but nothing
else.

The reason of stall is that ARM Global timer loses its contexts during
System suspend:
   GT_CONTROL.TIMER_ENABLE = 0 (unbanked)
   GT_COUNTERx = 0

Hence, update ARM Global timer driver to reflect above behaviour
- re-enable ARM Global timer on resume (GT_CONTROL.TIMER_ENABLE = 1)
  if not enabled.

CC: Arnd Bergmann <arnd@arndb.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/arm_global_timer.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index f99be6b..d189d8c 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -195,12 +195,23 @@ static cycle_t gt_clocksource_read(struct clocksource *cs)
 	return gt_counter_read();
 }
 
+static void gt_resume(struct clocksource *cs)
+{
+	unsigned long ctrl;
+
+	ctrl = readl(gt_base + GT_CONTROL);
+	if (!(ctrl & GT_CONTROL_TIMER_ENABLE))
+		/* re-enable timer on resume */
+		writel(GT_CONTROL_TIMER_ENABLE, gt_base + GT_CONTROL);
+}
+
 static struct clocksource gt_clocksource = {
 	.name	= "arm_global_timer",
 	.rating	= 300,
 	.read	= gt_clocksource_read,
 	.mask	= CLOCKSOURCE_MASK(64),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
+	.resume = gt_resume,
 };
 
 #ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 63/69] clocksource/drivers/arm_global_timer: Fix suspend resume
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Grygorii Strashko <grygorii.strashko@ti.com>

Now the System stall is observed on TI AM437x based board (am437x-gp-evm)
during resuming from System suspend when ARM Global timer is selected as
clocksource device (CPUIdle not enabled) - SysRq are working, but nothing
else.

The reason of stall is that ARM Global timer loses its contexts during
System suspend:
   GT_CONTROL.TIMER_ENABLE = 0 (unbanked)
   GT_COUNTERx = 0

Hence, update ARM Global timer driver to reflect above behaviour
- re-enable ARM Global timer on resume (GT_CONTROL.TIMER_ENABLE = 1)
  if not enabled.

CC: Arnd Bergmann <arnd@arndb.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/arm_global_timer.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index f99be6b..d189d8c 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -195,12 +195,23 @@ static cycle_t gt_clocksource_read(struct clocksource *cs)
 	return gt_counter_read();
 }
 
+static void gt_resume(struct clocksource *cs)
+{
+	unsigned long ctrl;
+
+	ctrl = readl(gt_base + GT_CONTROL);
+	if (!(ctrl & GT_CONTROL_TIMER_ENABLE))
+		/* re-enable timer on resume */
+		writel(GT_CONTROL_TIMER_ENABLE, gt_base + GT_CONTROL);
+}
+
 static struct clocksource gt_clocksource = {
 	.name	= "arm_global_timer",
 	.rating	= 300,
 	.read	= gt_clocksource_read,
 	.mask	= CLOCKSOURCE_MASK(64),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
+	.resume = gt_resume,
 };
 
 #ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 64/69] clocksource/drivers/lpc32: Correct pr_err() output format
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Vladimir Zapolskiy,
	Joachim Eastwood

From: Vladimir Zapolskiy <vz@mleia.com>

If by some reason timerclk is not available, both clockevent and
clocksource initializations correctly exit, but output of errno to
kernel log buffer may be confusing:

  lpc32xx_clk_init: failed to map system control block registers
  lpc32xx_clocksource_init: clock get failed (4294966779)
  lpc32xx_clockevent_init: clock get failed (4294966779)

Use signed integer output in the correspondent pr_err() string formats:

  lpc32xx_clocksource_init: clock get failed (-517)
  lpc32xx_clockevent_init: clock get failed (-517)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/time-lpc32xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/time-lpc32xx.c b/drivers/clocksource/time-lpc32xx.c
index a1c06a2..1316876 100644
--- a/drivers/clocksource/time-lpc32xx.c
+++ b/drivers/clocksource/time-lpc32xx.c
@@ -125,7 +125,7 @@ static int __init lpc32xx_clocksource_init(struct device_node *np)
 
 	clk = of_clk_get_by_name(np, "timerclk");
 	if (IS_ERR(clk)) {
-		pr_err("clock get failed (%lu)\n", PTR_ERR(clk));
+		pr_err("clock get failed (%ld)\n", PTR_ERR(clk));
 		return PTR_ERR(clk);
 	}
 
@@ -184,7 +184,7 @@ static int __init lpc32xx_clockevent_init(struct device_node *np)
 
 	clk = of_clk_get_by_name(np, "timerclk");
 	if (IS_ERR(clk)) {
-		pr_err("clock get failed (%lu)\n", PTR_ERR(clk));
+		pr_err("clock get failed (%ld)\n", PTR_ERR(clk));
 		return PTR_ERR(clk);
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 64/69] clocksource/drivers/lpc32: Correct pr_err() output format
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vladimir Zapolskiy <vz@mleia.com>

If by some reason timerclk is not available, both clockevent and
clocksource initializations correctly exit, but output of errno to
kernel log buffer may be confusing:

  lpc32xx_clk_init: failed to map system control block registers
  lpc32xx_clocksource_init: clock get failed (4294966779)
  lpc32xx_clockevent_init: clock get failed (4294966779)

Use signed integer output in the correspondent pr_err() string formats:

  lpc32xx_clocksource_init: clock get failed (-517)
  lpc32xx_clockevent_init: clock get failed (-517)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/time-lpc32xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/time-lpc32xx.c b/drivers/clocksource/time-lpc32xx.c
index a1c06a2..1316876 100644
--- a/drivers/clocksource/time-lpc32xx.c
+++ b/drivers/clocksource/time-lpc32xx.c
@@ -125,7 +125,7 @@ static int __init lpc32xx_clocksource_init(struct device_node *np)
 
 	clk = of_clk_get_by_name(np, "timerclk");
 	if (IS_ERR(clk)) {
-		pr_err("clock get failed (%lu)\n", PTR_ERR(clk));
+		pr_err("clock get failed (%ld)\n", PTR_ERR(clk));
 		return PTR_ERR(clk);
 	}
 
@@ -184,7 +184,7 @@ static int __init lpc32xx_clockevent_init(struct device_node *np)
 
 	clk = of_clk_get_by_name(np, "timerclk");
 	if (IS_ERR(clk)) {
-		pr_err("clock get failed (%lu)\n", PTR_ERR(clk));
+		pr_err("clock get failed (%ld)\n", PTR_ERR(clk));
 		return PTR_ERR(clk);
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 65/69] clocksource/drivers/h8300: Change to overflow interrupt
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Counter overflow detection use for overflow interrupt

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index fc14a3f..b14a8da 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -14,7 +14,6 @@
 #include <linux/of_irq.h>
 
 #define TSTR	0
-#define TISRA	4
 #define TISRC	6
 
 #define TCR	0
@@ -27,9 +26,8 @@ struct timer16_priv {
 	void __iomem *mapcommon;
 	unsigned short cs_enabled;
 	unsigned char enb;
-	unsigned char imfa;
-	unsigned char imiea;
 	unsigned char ovf;
+	unsigned char ovie;
 	struct clk *clk;
 };
 
@@ -59,8 +57,8 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	writeb(readb(p->mapcommon + TISRA) & ~p->imfa,
-		  p->mapcommon + TISRA);
+	writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
+		  p->mapcommon + TISRC);
 	p->total_cycles += 0x10000;
 
 	return IRQ_HANDLED;
@@ -93,6 +91,8 @@ static int timer16_enable(struct clocksource *cs)
 	writeb(0x83, p->mapbase + TCR);
 	writeb(readb(p->mapcommon + TSTR) | p->enb,
 		  p->mapcommon + TSTR);
+	writeb(readb(p->mapcommon + TISRC) | p->ovie,
+		  p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -161,8 +161,8 @@ static void __init h8300_16timer_init(struct device_node *node)
 	timer16_priv.mapbase = base[REG_CH];
 	timer16_priv.mapcommon = base[REG_COMM];
 	timer16_priv.enb = 1 << ch;
-	timer16_priv.imfa = 1 << ch;
-	timer16_priv.imiea = 1 << (4 + ch);
+	timer16_priv.ovf = 1 << ch;
+	timer16_priv.ovie = 1 << (4 + ch);
 
 	ret = request_irq(irq, timer16_interrupt,
 			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 65/69] clocksource/drivers/h8300: Change to overflow interrupt
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Counter overflow detection use for overflow interrupt

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index fc14a3f..b14a8da 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -14,7 +14,6 @@
 #include <linux/of_irq.h>
 
 #define TSTR	0
-#define TISRA	4
 #define TISRC	6
 
 #define TCR	0
@@ -27,9 +26,8 @@ struct timer16_priv {
 	void __iomem *mapcommon;
 	unsigned short cs_enabled;
 	unsigned char enb;
-	unsigned char imfa;
-	unsigned char imiea;
 	unsigned char ovf;
+	unsigned char ovie;
 	struct clk *clk;
 };
 
@@ -59,8 +57,8 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	writeb(readb(p->mapcommon + TISRA) & ~p->imfa,
-		  p->mapcommon + TISRA);
+	writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
+		  p->mapcommon + TISRC);
 	p->total_cycles += 0x10000;
 
 	return IRQ_HANDLED;
@@ -93,6 +91,8 @@ static int timer16_enable(struct clocksource *cs)
 	writeb(0x83, p->mapbase + TCR);
 	writeb(readb(p->mapcommon + TSTR) | p->enb,
 		  p->mapcommon + TSTR);
+	writeb(readb(p->mapcommon + TISRC) | p->ovie,
+		  p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -161,8 +161,8 @@ static void __init h8300_16timer_init(struct device_node *node)
 	timer16_priv.mapbase = base[REG_CH];
 	timer16_priv.mapcommon = base[REG_COMM];
 	timer16_priv.enb = 1 << ch;
-	timer16_priv.imfa = 1 << ch;
-	timer16_priv.imiea = 1 << (4 + ch);
+	timer16_priv.ovf = 1 << ch;
+	timer16_priv.ovie = 1 << (4 + ch);
 
 	ret = request_irq(irq, timer16_interrupt,
 			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 66/69] clocksource/drivers/h8300: Fix timer not overflow case
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index b14a8da..934ed0b 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -48,8 +48,10 @@ static unsigned long timer16_get_counter(struct timer16_priv *p)
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
-	v2 |= 0x10000;
-	return v2;
+	if (likely(!o1))
+		return v2;
+	else
+		return v2 + 0x10000;
 }
 
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 66/69] clocksource/drivers/h8300: Fix timer not overflow case
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index b14a8da..934ed0b 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -48,8 +48,10 @@ static unsigned long timer16_get_counter(struct timer16_priv *p)
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
-	v2 |= 0x10000;
-	return v2;
+	if (likely(!o1))
+		return v2;
+	else
+		return v2 + 0x10000;
 }
 
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 67/69] clocksource/drivers/h8300: Simplify delta handling
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 40 ++++++--------------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index aa4b2a98..1ba453b 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -36,57 +36,29 @@ struct timer8_priv {
 	unsigned int tcora;
 };
 
-static unsigned long timer8_get_counter(struct timer8_priv *p)
-{
-	unsigned long v1, v2, v3;
-	int o1, o2;
-
-	o1 = readb(p->mapbase + _8TCSR) & 0x20;
-
-	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
-	do {
-		o2 = o1;
-		v1 = readw(p->mapbase + _8TCNT);
-		v2 = readw(p->mapbase + _8TCNT);
-		v3 = readw(p->mapbase + _8TCNT);
-		o1 = readb(p->mapbase + _8TCSR) & 0x20;
-	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
-			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
-
-	v2 |= o1 << 10;
-	return v2;
-}
-
 static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 {
 	struct timer8_priv *p = dev_id;
 
-	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
-		  p->mapbase + _8TCSR);
-
-	writew(p->tcora, p->mapbase + TCORA);
-
 	if (clockevent_state_oneshot(&p->ced))
 		writew(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
+	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
+		  p->mapbase + _8TCSR);
+
 	return IRQ_HANDLED;
 }
 
 static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
-	unsigned long now;
-
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
-	now = timer8_get_counter(p);
-	p->tcora = delta;
+	writeb(readb(p->mapbase + _8TCR) & ~0x40, p->mapbase + _8TCR);
+	writew(0, p->mapbase + _8TCNT);
+	writew(delta, p->mapbase + TCORA);
 	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
-	if (delta > now)
-		writew(delta, p->mapbase + TCORA);
-	else
-		writew(now + 1, p->mapbase + TCORA);
 }
 
 static int timer8_enable(struct timer8_priv *p)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 67/69] clocksource/drivers/h8300: Simplify delta handling
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 40 ++++++--------------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index aa4b2a98..1ba453b 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -36,57 +36,29 @@ struct timer8_priv {
 	unsigned int tcora;
 };
 
-static unsigned long timer8_get_counter(struct timer8_priv *p)
-{
-	unsigned long v1, v2, v3;
-	int o1, o2;
-
-	o1 = readb(p->mapbase + _8TCSR) & 0x20;
-
-	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
-	do {
-		o2 = o1;
-		v1 = readw(p->mapbase + _8TCNT);
-		v2 = readw(p->mapbase + _8TCNT);
-		v3 = readw(p->mapbase + _8TCNT);
-		o1 = readb(p->mapbase + _8TCSR) & 0x20;
-	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
-			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
-
-	v2 |= o1 << 10;
-	return v2;
-}
-
 static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 {
 	struct timer8_priv *p = dev_id;
 
-	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
-		  p->mapbase + _8TCSR);
-
-	writew(p->tcora, p->mapbase + TCORA);
-
 	if (clockevent_state_oneshot(&p->ced))
 		writew(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
+	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
+		  p->mapbase + _8TCSR);
+
 	return IRQ_HANDLED;
 }
 
 static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
-	unsigned long now;
-
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
-	now = timer8_get_counter(p);
-	p->tcora = delta;
+	writeb(readb(p->mapbase + _8TCR) & ~0x40, p->mapbase + _8TCR);
+	writew(0, p->mapbase + _8TCNT);
+	writew(delta, p->mapbase + TCORA);
 	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
-	if (delta > now)
-		writew(delta, p->mapbase + TCORA);
-	else
-		writew(now + 1, p->mapbase + TCORA);
 }
 
 static int timer8_enable(struct timer8_priv *p)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 68/69] clocksource/drivers/h8300: Initializer cleanup.
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 1ba453b..9087dd2 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -33,7 +33,6 @@ struct timer8_priv {
 	void __iomem *mapbase;
 	unsigned long flags;
 	unsigned int rate;
-	unsigned int tcora;
 };
 
 static irqreturn_t timer8_interrupt(int irq, void *dev_id)
@@ -163,8 +162,6 @@ static void __init h8300_8timer_init(struct device_node *node)
 {
 	void __iomem *base;
 	int irq;
-	int ret = 0;
-	int rate;
 	struct clk *clk;
 
 	clk = of_clk_get(node, 0);
@@ -187,20 +184,20 @@ static void __init h8300_8timer_init(struct device_node *node)
 
 	timer8_priv.mapbase = base;
 
-	rate = clk_get_rate(clk) / SCALE;
-	if (!rate) {
+	timer8_priv.rate = clk_get_rate(clk) / SCALE;
+	if (!timer8_priv.rate) {
 		pr_err("Failed to get rate for the clocksource\n");
 		goto unmap_reg;
 	}
 
-	ret = request_irq(irq, timer8_interrupt,
-			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
-	if (ret < 0) {
+	if (request_irq(irq, timer8_interrupt, IRQF_TIMER,
+			timer8_priv.ced.name, &timer8_priv) < 0) {
 		pr_err("failed to request irq %d for clockevent\n", irq);
 		goto unmap_reg;
 	}
 
-	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
+	clockevents_config_and_register(&timer8_priv.ced,
+					timer8_priv.rate, 1, 0x0000ffff);
 
 	return;
 unmap_reg:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 68/69] clocksource/drivers/h8300: Initializer cleanup.
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 1ba453b..9087dd2 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -33,7 +33,6 @@ struct timer8_priv {
 	void __iomem *mapbase;
 	unsigned long flags;
 	unsigned int rate;
-	unsigned int tcora;
 };
 
 static irqreturn_t timer8_interrupt(int irq, void *dev_id)
@@ -163,8 +162,6 @@ static void __init h8300_8timer_init(struct device_node *node)
 {
 	void __iomem *base;
 	int irq;
-	int ret = 0;
-	int rate;
 	struct clk *clk;
 
 	clk = of_clk_get(node, 0);
@@ -187,20 +184,20 @@ static void __init h8300_8timer_init(struct device_node *node)
 
 	timer8_priv.mapbase = base;
 
-	rate = clk_get_rate(clk) / SCALE;
-	if (!rate) {
+	timer8_priv.rate = clk_get_rate(clk) / SCALE;
+	if (!timer8_priv.rate) {
 		pr_err("Failed to get rate for the clocksource\n");
 		goto unmap_reg;
 	}
 
-	ret = request_irq(irq, timer8_interrupt,
-			  IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
-	if (ret < 0) {
+	if (request_irq(irq, timer8_interrupt, IRQF_TIMER,
+			timer8_priv.ced.name, &timer8_priv) < 0) {
 		pr_err("failed to request irq %d for clockevent\n", irq);
 		goto unmap_reg;
 	}
 
-	clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
+	clockevents_config_and_register(&timer8_priv.ced,
+					timer8_priv.rate, 1, 0x0000ffff);
 
 	return;
 unmap_reg:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 69/69] clocksource/drivers/h8300: Use ioread / iowrite
  2015-12-18 14:17   ` Daniel Lezcano
@ 2015-12-18 14:18     ` Daniel Lezcano
  -1 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 43 ++++++++++++++++++-------------------
 drivers/clocksource/h8300_timer8.c  | 28 ++++++++++++++----------
 drivers/clocksource/h8300_tpu.c     | 22 ++++++++++---------
 3 files changed, 50 insertions(+), 43 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 934ed0b..75c4407 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -19,6 +19,9 @@
 #define TCR	0
 #define TCNT	2
 
+#define bset(b, a) iowrite8(ioread8(a) | (1 << (b)), (a))
+#define bclr(b, a) iowrite8(ioread8(a) & ~(1 << (b)), (a))
+
 struct timer16_priv {
 	struct clocksource cs;
 	unsigned long total_cycles;
@@ -28,23 +31,22 @@ struct timer16_priv {
 	unsigned char enb;
 	unsigned char ovf;
 	unsigned char ovie;
-	struct clk *clk;
 };
 
 static unsigned long timer16_get_counter(struct timer16_priv *p)
 {
-	unsigned long v1, v2, v3;
-	int o1, o2;
+	unsigned short v1, v2, v3;
+	unsigned char  o1, o2;
 
-	o1 = readb(p->mapcommon + TISRC) & p->ovf;
+	o1 = ioread8(p->mapcommon + TISRC) & p->ovf;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = readw(p->mapbase + TCNT);
-		v2 = readw(p->mapbase + TCNT);
-		v3 = readw(p->mapbase + TCNT);
-		o1 = readb(p->mapcommon + TISRC) & p->ovf;
+		v1 = ioread16be(p->mapbase + TCNT);
+		v2 = ioread16be(p->mapbase + TCNT);
+		v3 = ioread16be(p->mapbase + TCNT);
+		o1 = ioread8(p->mapcommon + TISRC) & p->ovf;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -59,8 +61,7 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
-		  p->mapcommon + TISRC);
+	bclr(p->ovf, p->mapcommon + TISRC);
 	p->total_cycles += 0x10000;
 
 	return IRQ_HANDLED;
@@ -89,12 +90,10 @@ static int timer16_enable(struct clocksource *cs)
 	WARN_ON(p->cs_enabled);
 
 	p->total_cycles = 0;
-	writew(0x0000, p->mapbase + TCNT);
-	writeb(0x83, p->mapbase + TCR);
-	writeb(readb(p->mapcommon + TSTR) | p->enb,
-		  p->mapcommon + TSTR);
-	writeb(readb(p->mapcommon + TISRC) | p->ovie,
-		  p->mapcommon + TSTR);
+	iowrite16be(0x0000, p->mapbase + TCNT);
+	iowrite8(0x83, p->mapbase + TCR);
+	bset(p->ovie, p->mapcommon + TISRC);
+	bset(p->enb, p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -106,8 +105,8 @@ static void timer16_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	writeb(readb(p->mapcommon + TSTR) & ~p->enb,
-		  p->mapcommon + TSTR);
+	bclr(p->ovie, p->mapcommon + TISRC);
+	bclr(p->enb, p->mapcommon + TSTR);
 
 	p->cs_enabled = false;
 }
@@ -162,9 +161,9 @@ static void __init h8300_16timer_init(struct device_node *node)
 
 	timer16_priv.mapbase = base[REG_CH];
 	timer16_priv.mapcommon = base[REG_COMM];
-	timer16_priv.enb = 1 << ch;
-	timer16_priv.ovf = 1 << ch;
-	timer16_priv.ovie = 1 << (4 + ch);
+	timer16_priv.enb = ch;
+	timer16_priv.ovf = ch;
+	timer16_priv.ovie = 4 + ch;
 
 	ret = request_irq(irq, timer16_interrupt,
 			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
@@ -174,7 +173,7 @@ static void __init h8300_16timer_init(struct device_node *node)
 	}
 
 	clocksource_register_hz(&timer16_priv.cs,
-				clk_get_rate(timer16_priv.clk) / 8);
+				clk_get_rate(clk) / 8);
 	return;
 
 unmap_comm:
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 9087dd2..c151941 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,10 +24,16 @@
 #define TCORB	6
 #define _8TCNT	8
 
+#define CMIEA	6
+#define CMFA	6
+
 #define FLAG_STARTED (1 << 3)
 
 #define SCALE 64
 
+#define bset(b, a) iowrite8(ioread8(a) | (1 << (b)), (a))
+#define bclr(b, a) iowrite8(ioread8(a) & ~(1 << (b)), (a))
+
 struct timer8_priv {
 	struct clock_event_device ced;
 	void __iomem *mapbase;
@@ -40,12 +46,11 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 	struct timer8_priv *p = dev_id;
 
 	if (clockevent_state_oneshot(&p->ced))
-		writew(0x0000, p->mapbase + _8TCR);
+		iowrite16be(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
-	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
-		  p->mapbase + _8TCSR);
+	bclr(CMFA, p->mapbase + _8TCSR);
 
 	return IRQ_HANDLED;
 }
@@ -54,17 +59,18 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
-	writeb(readb(p->mapbase + _8TCR) & ~0x40, p->mapbase + _8TCR);
-	writew(0, p->mapbase + _8TCNT);
-	writew(delta, p->mapbase + TCORA);
-	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
+	bclr(CMIEA, p->mapbase + _8TCR);
+	iowrite16be(delta, p->mapbase + TCORA);
+	iowrite16be(0x0000, p->mapbase + _8TCNT);
+	bclr(CMFA, p->mapbase + _8TCSR);
+	bset(CMIEA, p->mapbase + _8TCR);
 }
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	writew(0xffff, p->mapbase + TCORA);
-	writew(0x0000, p->mapbase + _8TCNT);
-	writew(0x0c02, p->mapbase + _8TCR);
+	iowrite16be(0xffff, p->mapbase + TCORA);
+	iowrite16be(0x0000, p->mapbase + _8TCNT);
+	iowrite16be(0x0c02, p->mapbase + _8TCR);
 
 	return 0;
 }
@@ -85,7 +91,7 @@ static int timer8_start(struct timer8_priv *p)
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	writew(0x0000, p->mapbase + _8TCR);
+	iowrite16be(0x0000, p->mapbase + _8TCR);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 91bf1992..d4c1a28 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -19,6 +19,8 @@
 #define TSR	0x5
 #define TCNT	0x6
 
+#define TCFV	0x10
+
 struct tpu_priv {
 	struct clocksource cs;
 	void __iomem *mapbase1;
@@ -31,8 +33,8 @@ static inline unsigned long read_tcnt32(struct tpu_priv *p)
 {
 	unsigned long tcnt;
 
-	tcnt = readw(p->mapbase1 + TCNT) << 16;
-	tcnt |= readw(p->mapbase2 + TCNT);
+	tcnt = ioread16be(p->mapbase1 + TCNT) << 16;
+	tcnt |= ioread16be(p->mapbase2 + TCNT);
 	return tcnt;
 }
 
@@ -41,7 +43,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = readb(p->mapbase1 + TSR) & 0x10;
+	o1 = ioread8(p->mapbase1 + TSR) & TCFV;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
@@ -49,7 +51,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 		v1 = read_tcnt32(p);
 		v2 = read_tcnt32(p);
 		v3 = read_tcnt32(p);
-		o1 = readb(p->mapbase1 + TSR) & 0x10;
+		o1 = ioread8(p->mapbase1 + TSR) & TCFV;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -82,10 +84,10 @@ static int tpu_clocksource_enable(struct clocksource *cs)
 
 	WARN_ON(p->cs_enabled);
 
-	writew(0, p->mapbase1 + TCNT);
-	writew(0, p->mapbase2 + TCNT);
-	writeb(0x0f, p->mapbase1 + TCR);
-	writeb(0x03, p->mapbase2 + TCR);
+	iowrite16be(0, p->mapbase1 + TCNT);
+	iowrite16be(0, p->mapbase2 + TCNT);
+	iowrite8(0x0f, p->mapbase1 + TCR);
+	iowrite8(0x03, p->mapbase2 + TCR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -97,8 +99,8 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	writeb(0, p->mapbase1 + TCR);
-	writeb(0, p->mapbase2 + TCR);
+	iowrite8(0, p->mapbase1 + TCR);
+	iowrite8(0, p->mapbase2 + TCR);
 	p->cs_enabled = false;
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 154+ messages in thread

* [PATCH 69/69] clocksource/drivers/h8300: Use ioread / iowrite
@ 2015-12-18 14:18     ` Daniel Lezcano
  0 siblings, 0 replies; 154+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yoshinori Sato <ysato@users.sourceforge.jp>

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer16.c | 43 ++++++++++++++++++-------------------
 drivers/clocksource/h8300_timer8.c  | 28 ++++++++++++++----------
 drivers/clocksource/h8300_tpu.c     | 22 ++++++++++---------
 3 files changed, 50 insertions(+), 43 deletions(-)

diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 934ed0b..75c4407 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -19,6 +19,9 @@
 #define TCR	0
 #define TCNT	2
 
+#define bset(b, a) iowrite8(ioread8(a) | (1 << (b)), (a))
+#define bclr(b, a) iowrite8(ioread8(a) & ~(1 << (b)), (a))
+
 struct timer16_priv {
 	struct clocksource cs;
 	unsigned long total_cycles;
@@ -28,23 +31,22 @@ struct timer16_priv {
 	unsigned char enb;
 	unsigned char ovf;
 	unsigned char ovie;
-	struct clk *clk;
 };
 
 static unsigned long timer16_get_counter(struct timer16_priv *p)
 {
-	unsigned long v1, v2, v3;
-	int o1, o2;
+	unsigned short v1, v2, v3;
+	unsigned char  o1, o2;
 
-	o1 = readb(p->mapcommon + TISRC) & p->ovf;
+	o1 = ioread8(p->mapcommon + TISRC) & p->ovf;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
 		o2 = o1;
-		v1 = readw(p->mapbase + TCNT);
-		v2 = readw(p->mapbase + TCNT);
-		v3 = readw(p->mapbase + TCNT);
-		o1 = readb(p->mapcommon + TISRC) & p->ovf;
+		v1 = ioread16be(p->mapbase + TCNT);
+		v2 = ioread16be(p->mapbase + TCNT);
+		v3 = ioread16be(p->mapbase + TCNT);
+		o1 = ioread8(p->mapcommon + TISRC) & p->ovf;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -59,8 +61,7 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
 {
 	struct timer16_priv *p = (struct timer16_priv *)dev_id;
 
-	writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
-		  p->mapcommon + TISRC);
+	bclr(p->ovf, p->mapcommon + TISRC);
 	p->total_cycles += 0x10000;
 
 	return IRQ_HANDLED;
@@ -89,12 +90,10 @@ static int timer16_enable(struct clocksource *cs)
 	WARN_ON(p->cs_enabled);
 
 	p->total_cycles = 0;
-	writew(0x0000, p->mapbase + TCNT);
-	writeb(0x83, p->mapbase + TCR);
-	writeb(readb(p->mapcommon + TSTR) | p->enb,
-		  p->mapcommon + TSTR);
-	writeb(readb(p->mapcommon + TISRC) | p->ovie,
-		  p->mapcommon + TSTR);
+	iowrite16be(0x0000, p->mapbase + TCNT);
+	iowrite8(0x83, p->mapbase + TCR);
+	bset(p->ovie, p->mapcommon + TISRC);
+	bset(p->enb, p->mapcommon + TSTR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -106,8 +105,8 @@ static void timer16_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	writeb(readb(p->mapcommon + TSTR) & ~p->enb,
-		  p->mapcommon + TSTR);
+	bclr(p->ovie, p->mapcommon + TISRC);
+	bclr(p->enb, p->mapcommon + TSTR);
 
 	p->cs_enabled = false;
 }
@@ -162,9 +161,9 @@ static void __init h8300_16timer_init(struct device_node *node)
 
 	timer16_priv.mapbase = base[REG_CH];
 	timer16_priv.mapcommon = base[REG_COMM];
-	timer16_priv.enb = 1 << ch;
-	timer16_priv.ovf = 1 << ch;
-	timer16_priv.ovie = 1 << (4 + ch);
+	timer16_priv.enb = ch;
+	timer16_priv.ovf = ch;
+	timer16_priv.ovie = 4 + ch;
 
 	ret = request_irq(irq, timer16_interrupt,
 			  IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
@@ -174,7 +173,7 @@ static void __init h8300_16timer_init(struct device_node *node)
 	}
 
 	clocksource_register_hz(&timer16_priv.cs,
-				clk_get_rate(timer16_priv.clk) / 8);
+				clk_get_rate(clk) / 8);
 	return;
 
 unmap_comm:
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 9087dd2..c151941 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,10 +24,16 @@
 #define TCORB	6
 #define _8TCNT	8
 
+#define CMIEA	6
+#define CMFA	6
+
 #define FLAG_STARTED (1 << 3)
 
 #define SCALE 64
 
+#define bset(b, a) iowrite8(ioread8(a) | (1 << (b)), (a))
+#define bclr(b, a) iowrite8(ioread8(a) & ~(1 << (b)), (a))
+
 struct timer8_priv {
 	struct clock_event_device ced;
 	void __iomem *mapbase;
@@ -40,12 +46,11 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
 	struct timer8_priv *p = dev_id;
 
 	if (clockevent_state_oneshot(&p->ced))
-		writew(0x0000, p->mapbase + _8TCR);
+		iowrite16be(0x0000, p->mapbase + _8TCR);
 
 	p->ced.event_handler(&p->ced);
 
-	writeb(readb(p->mapbase + _8TCSR) & ~0x40,
-		  p->mapbase + _8TCSR);
+	bclr(CMFA, p->mapbase + _8TCSR);
 
 	return IRQ_HANDLED;
 }
@@ -54,17 +59,18 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
 {
 	if (delta >= 0x10000)
 		pr_warn("delta out of range\n");
-	writeb(readb(p->mapbase + _8TCR) & ~0x40, p->mapbase + _8TCR);
-	writew(0, p->mapbase + _8TCNT);
-	writew(delta, p->mapbase + TCORA);
-	writeb(readb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
+	bclr(CMIEA, p->mapbase + _8TCR);
+	iowrite16be(delta, p->mapbase + TCORA);
+	iowrite16be(0x0000, p->mapbase + _8TCNT);
+	bclr(CMFA, p->mapbase + _8TCSR);
+	bset(CMIEA, p->mapbase + _8TCR);
 }
 
 static int timer8_enable(struct timer8_priv *p)
 {
-	writew(0xffff, p->mapbase + TCORA);
-	writew(0x0000, p->mapbase + _8TCNT);
-	writew(0x0c02, p->mapbase + _8TCR);
+	iowrite16be(0xffff, p->mapbase + TCORA);
+	iowrite16be(0x0000, p->mapbase + _8TCNT);
+	iowrite16be(0x0c02, p->mapbase + _8TCR);
 
 	return 0;
 }
@@ -85,7 +91,7 @@ static int timer8_start(struct timer8_priv *p)
 
 static void timer8_stop(struct timer8_priv *p)
 {
-	writew(0x0000, p->mapbase + _8TCR);
+	iowrite16be(0x0000, p->mapbase + _8TCR);
 }
 
 static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 91bf1992..d4c1a28 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -19,6 +19,8 @@
 #define TSR	0x5
 #define TCNT	0x6
 
+#define TCFV	0x10
+
 struct tpu_priv {
 	struct clocksource cs;
 	void __iomem *mapbase1;
@@ -31,8 +33,8 @@ static inline unsigned long read_tcnt32(struct tpu_priv *p)
 {
 	unsigned long tcnt;
 
-	tcnt = readw(p->mapbase1 + TCNT) << 16;
-	tcnt |= readw(p->mapbase2 + TCNT);
+	tcnt = ioread16be(p->mapbase1 + TCNT) << 16;
+	tcnt |= ioread16be(p->mapbase2 + TCNT);
 	return tcnt;
 }
 
@@ -41,7 +43,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 	unsigned long v1, v2, v3;
 	int o1, o2;
 
-	o1 = readb(p->mapbase1 + TSR) & 0x10;
+	o1 = ioread8(p->mapbase1 + TSR) & TCFV;
 
 	/* Make sure the timer value is stable. Stolen from acpi_pm.c */
 	do {
@@ -49,7 +51,7 @@ static int tpu_get_counter(struct tpu_priv *p, unsigned long long *val)
 		v1 = read_tcnt32(p);
 		v2 = read_tcnt32(p);
 		v3 = read_tcnt32(p);
-		o1 = readb(p->mapbase1 + TSR) & 0x10;
+		o1 = ioread8(p->mapbase1 + TSR) & TCFV;
 	} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
 			  || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
 
@@ -82,10 +84,10 @@ static int tpu_clocksource_enable(struct clocksource *cs)
 
 	WARN_ON(p->cs_enabled);
 
-	writew(0, p->mapbase1 + TCNT);
-	writew(0, p->mapbase2 + TCNT);
-	writeb(0x0f, p->mapbase1 + TCR);
-	writeb(0x03, p->mapbase2 + TCR);
+	iowrite16be(0, p->mapbase1 + TCNT);
+	iowrite16be(0, p->mapbase2 + TCNT);
+	iowrite8(0x0f, p->mapbase1 + TCR);
+	iowrite8(0x03, p->mapbase2 + TCR);
 
 	p->cs_enabled = true;
 	return 0;
@@ -97,8 +99,8 @@ static void tpu_clocksource_disable(struct clocksource *cs)
 
 	WARN_ON(!p->cs_enabled);
 
-	writeb(0, p->mapbase1 + TCR);
-	writeb(0, p->mapbase2 + TCR);
+	iowrite8(0, p->mapbase1 + TCR);
+	iowrite8(0, p->mapbase2 + TCR);
 	p->cs_enabled = false;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 154+ messages in thread

* Re: [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
  2015-12-18 14:17     ` Daniel Lezcano
  (?)
@ 2015-12-30 18:15       ` Matthias Brugger
  -1 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:15 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> From: Alexey Klimov <alexey.klimov@linaro.org>
>
> 1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
>     warnings.
> 2) Add missing \n.
> 3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
>     There is generic stack_dump() for allocation issues.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/mtk_timer.c | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index 8f99cd7..e1e0642 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
>   	struct clk *clk;
>
>   	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> -	if (!evt) {
> -		pr_warn("Can't allocate mtk clock event driver struct");
> +	if (!evt)
>   		return;
> -	}
>
>   	evt->dev.name = "mtk_tick";
>   	evt->dev.rating = 300;
> @@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
>
>   	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
>   	if (IS_ERR(evt->gpt_base)) {
> -		pr_warn("Can't get resource\n");
> +		pr_err("Can't get resource\n");
>   		return;
>   	}
>
>   	evt->dev.irq = irq_of_parse_and_map(node, 0);
>   	if (evt->dev.irq <= 0) {
> -		pr_warn("Can't parse IRQ");
> +		pr_err("Can't parse IRQ\n");
>   		goto err_mem;
>   	}
>
>   	clk = of_clk_get(node, 0);
>   	if (IS_ERR(clk)) {
> -		pr_warn("Can't get timer clock");
> +		pr_err("Can't get timer clock\n");
>   		goto err_irq;
>   	}
>
>   	if (clk_prepare_enable(clk)) {
> -		pr_warn("Can't prepare clock");
> +		pr_err("Can't prepare clock\n");
>   		goto err_clk_put;
>   	}
>   	rate = clk_get_rate(clk);
>
>   	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
>   			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
> -		pr_warn("failed to setup irq %d\n", evt->dev.irq);
> +		pr_err("failed to setup irq %d\n", evt->dev.irq);
>   		goto err_clk_disable;
>   	}
>
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

* Re: [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
@ 2015-12-30 18:15       ` Matthias Brugger
  0 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:15 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> From: Alexey Klimov <alexey.klimov@linaro.org>
>
> 1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
>     warnings.
> 2) Add missing \n.
> 3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
>     There is generic stack_dump() for allocation issues.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/mtk_timer.c | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index 8f99cd7..e1e0642 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
>   	struct clk *clk;
>
>   	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> -	if (!evt) {
> -		pr_warn("Can't allocate mtk clock event driver struct");
> +	if (!evt)
>   		return;
> -	}
>
>   	evt->dev.name = "mtk_tick";
>   	evt->dev.rating = 300;
> @@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
>
>   	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
>   	if (IS_ERR(evt->gpt_base)) {
> -		pr_warn("Can't get resource\n");
> +		pr_err("Can't get resource\n");
>   		return;
>   	}
>
>   	evt->dev.irq = irq_of_parse_and_map(node, 0);
>   	if (evt->dev.irq <= 0) {
> -		pr_warn("Can't parse IRQ");
> +		pr_err("Can't parse IRQ\n");
>   		goto err_mem;
>   	}
>
>   	clk = of_clk_get(node, 0);
>   	if (IS_ERR(clk)) {
> -		pr_warn("Can't get timer clock");
> +		pr_err("Can't get timer clock\n");
>   		goto err_irq;
>   	}
>
>   	if (clk_prepare_enable(clk)) {
> -		pr_warn("Can't prepare clock");
> +		pr_err("Can't prepare clock\n");
>   		goto err_clk_put;
>   	}
>   	rate = clk_get_rate(clk);
>
>   	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
>   			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
> -		pr_warn("failed to setup irq %d\n", evt->dev.irq);
> +		pr_err("failed to setup irq %d\n", evt->dev.irq);
>   		goto err_clk_disable;
>   	}
>
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

* [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
@ 2015-12-30 18:15       ` Matthias Brugger
  0 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:15 UTC (permalink / raw)
  To: linux-arm-kernel



On 18/12/15 15:17, Daniel Lezcano wrote:
> From: Alexey Klimov <alexey.klimov@linaro.org>
>
> 1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
>     warnings.
> 2) Add missing \n.
> 3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
>     There is generic stack_dump() for allocation issues.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/mtk_timer.c | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index 8f99cd7..e1e0642 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
>   	struct clk *clk;
>
>   	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> -	if (!evt) {
> -		pr_warn("Can't allocate mtk clock event driver struct");
> +	if (!evt)
>   		return;
> -	}
>
>   	evt->dev.name = "mtk_tick";
>   	evt->dev.rating = 300;
> @@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
>
>   	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
>   	if (IS_ERR(evt->gpt_base)) {
> -		pr_warn("Can't get resource\n");
> +		pr_err("Can't get resource\n");
>   		return;
>   	}
>
>   	evt->dev.irq = irq_of_parse_and_map(node, 0);
>   	if (evt->dev.irq <= 0) {
> -		pr_warn("Can't parse IRQ");
> +		pr_err("Can't parse IRQ\n");
>   		goto err_mem;
>   	}
>
>   	clk = of_clk_get(node, 0);
>   	if (IS_ERR(clk)) {
> -		pr_warn("Can't get timer clock");
> +		pr_err("Can't get timer clock\n");
>   		goto err_irq;
>   	}
>
>   	if (clk_prepare_enable(clk)) {
> -		pr_warn("Can't prepare clock");
> +		pr_err("Can't prepare clock\n");
>   		goto err_clk_put;
>   	}
>   	rate = clk_get_rate(clk);
>
>   	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
>   			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
> -		pr_warn("failed to setup irq %d\n", evt->dev.irq);
> +		pr_err("failed to setup irq %d\n", evt->dev.irq);
>   		goto err_clk_disable;
>   	}
>
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

* Re: [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
  2015-12-18 14:17     ` Daniel Lezcano
  (?)
@ 2015-12-30 18:16       ` Matthias Brugger
  -1 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:16 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> Increase the compilation test coverage by adding the COMPILE_TEST option.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/Kconfig | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index 96a34dc..3ba43f6 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
>           bool
>
>   config MTK_TIMER
> +	bool "Mediatek timer driver" if COMPILE_TEST
>   	select CLKSRC_OF
>   	select CLKSRC_MMIO
> -	bool
> +	help
> +	  Support for Mediatek timer driver.
>
>   config SYS_SUPPORTS_SH_MTU2
>           bool
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

* Re: [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
@ 2015-12-30 18:16       ` Matthias Brugger
  0 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:16 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> Increase the compilation test coverage by adding the COMPILE_TEST option.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/Kconfig | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index 96a34dc..3ba43f6 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
>           bool
>
>   config MTK_TIMER
> +	bool "Mediatek timer driver" if COMPILE_TEST
>   	select CLKSRC_OF
>   	select CLKSRC_MMIO
> -	bool
> +	help
> +	  Support for Mediatek timer driver.
>
>   config SYS_SUPPORTS_SH_MTU2
>           bool
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

* [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
@ 2015-12-30 18:16       ` Matthias Brugger
  0 siblings, 0 replies; 154+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:16 UTC (permalink / raw)
  To: linux-arm-kernel



On 18/12/15 15:17, Daniel Lezcano wrote:
> Increase the compilation test coverage by adding the COMPILE_TEST option.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/Kconfig | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index 96a34dc..3ba43f6 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
>           bool
>
>   config MTK_TIMER
> +	bool "Mediatek timer driver" if COMPILE_TEST
>   	select CLKSRC_OF
>   	select CLKSRC_MMIO
> -	bool
> +	help
> +	  Support for Mediatek timer driver.
>
>   config SYS_SUPPORTS_SH_MTU2
>           bool
>

^ permalink raw reply	[flat|nested] 154+ messages in thread

end of thread, other threads:[~2015-12-30 18:16 UTC | newest]

Thread overview: 154+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 14:50 [GIT PULL] clockevents for 4.5 Daniel Lezcano
2015-12-17 14:50 ` Daniel Lezcano
2015-12-18 14:17 ` [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define Daniel Lezcano
2015-12-18 14:17   ` Daniel Lezcano
2015-12-18 14:17   ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-30 18:15     ` Matthias Brugger
2015-12-30 18:15       ` Matthias Brugger
2015-12-30 18:15       ` Matthias Brugger
2015-12-18 14:17   ` [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init() Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 04/69] clocksource/drivers/tegra: Allow timer irq affinity change Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 05/69] clocksource/drivers/rockchip: Make the driver more readable Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 06/69] time: Define dummy functions for the generic sched clock Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 07/69] clocksource/drivers/rockchip: Remove dsb() usage Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 08/69] clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM architecture Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 09/69] clocksource/drivers/st_lpc: Fix Kconfig dependency Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 10/69] clocksource/drivers/st_lpc: Add the COMPILE_TEST option Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 11/69] clocksource/drivers/pxa_timer: Move the Kconfig rule Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 12/69] clocksource/drivers/pxa_timer: Add the COMPILE_TEST option Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 13/69] clocksource/drivers/tango: Add " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 14/69] clocksource/drivers/pistachio: Add the " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 15/69] clocksource/drivers/mediatek: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-30 18:16     ` Matthias Brugger
2015-12-30 18:16       ` Matthias Brugger
2015-12-30 18:16       ` Matthias Brugger
2015-12-18 14:17   ` [PATCH 16/69] clocksource/drivers/rockchip: Add " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 17/69] clocksource/drivers/armada-370-xp: Add the " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 18/69] clocksource/drivers/meson6: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 19/69] clocksource/drivers/orion: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 20/69] clocksource/drivers/digicolor: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 21/69] clocksource/drivers/dw_apb: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 22/69] clocksource/drivers/sun4i: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 23/69] clocksource/drivers/sun5i: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 24/69] clocksource/drivers/tegra2: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 25/69] clocksource/drivers/vt8500: Remove unneeded header Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 26/69] clocksource/drivers/vt8500: Add the COMPILE_TEST option Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 27/69] clocksource/drivers/cadence_ttc: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 28/69] clocksource/drivers/asm9260: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 29/69] clocksource/drivers/lpc32xx: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 30/69] clocksource/drivers/nomadik_mtu: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 31/69] clocksource/drivers/prcmu: Fix Kconfig and add " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 32/69] clocksource/drivers/exynos_mct: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 33/69] clocksource/drivers/samsung-pwm: Add the " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 34/69] clocksource/drivers/fsl-ftm: " Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 35/69] clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependency Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 36/69] clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 37/69] clocksource/drivers/h8300: Cleanup startup and remove module code Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 38/69] clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 39/69] clocksource/drivers/h8300_tpu: Remove unused macros Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 40/69] clocksource/drivers/h8300_tpu: Remove pointless headers for TPU Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 41/69] clocksource/drivers/h8300_timer8: Remove unused headers Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 42/69] clocksource/drivers/h8300_timer8: Remove unused macros Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 43/69] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 44/69] clocksource/drivers/h8300_timer8: Fix irq return value check Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 45/69] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:17   ` [PATCH 46/69] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code Daniel Lezcano
2015-12-18 14:17     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 47/69] clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 48/69] clocksource/drivers/h8300_timer16: Remove pointless headers Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 49/69] clocksource/drivers/h8300_timer16: Remove unused macros Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 50/69] clocksource/drivers/h8300_timer16: Remove unused fields in timer16_priv Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 51/69] clocksource/drivers/h8300_timer16: Fix irq return value check Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 52/69] clocksource/drivers/h8300_timer16: Remove pointless lock Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 53/69] clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 54/69] clocksource/drivers/h8300_timer8: Separate the Kconfig option from the arch Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 55/69] h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl] Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 56/69] clocksource/drivers/h8300: Increase the compilation test coverage Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 57/69] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 58/69] clocksource/drivers/dw_apb_timer: Fix apbt_readl return types Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 59/69] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical path Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 60/69] clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 61/69] clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_set Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 62/69] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 63/69] clocksource/drivers/arm_global_timer: Fix suspend resume Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 64/69] clocksource/drivers/lpc32: Correct pr_err() output format Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 65/69] clocksource/drivers/h8300: Change to overflow interrupt Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 66/69] clocksource/drivers/h8300: Fix timer not overflow case Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 67/69] clocksource/drivers/h8300: Simplify delta handling Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 68/69] clocksource/drivers/h8300: Initializer cleanup Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano
2015-12-18 14:18   ` [PATCH 69/69] clocksource/drivers/h8300: Use ioread / iowrite Daniel Lezcano
2015-12-18 14:18     ` Daniel Lezcano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.