Skip to contentSkip to conversation

clocksource/drivers/pistachio: Add the COMPILE_TEST option

PATCH In review Daniel Lezcano 6 participants 36 messages Nov 2, 2015 – Nov 3, 2015

Subsystems (7)
lore
Share & tools
lore
#1 lore raw

PATCH 2/22 clocksource/drivers/mediatek: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index a1c9312..dc79fde 100644
@@ -210,9 +210,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
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/22 clocksource/drivers/rockchip: Make the driver more compatible

In reply to Daniel Lezcano

From: Caesar Wang <[email protected]>

Build the arm64 SoCs (e.g.: RK3368) on Rockchip platform, There are some failure with build up on timer driver for rockchip.

Says:
/tmp/ccdAnNy5.s:47: Error: missing immediate expression at operand 1 -- dsb
...

The problem was different semantics of dsb on btw arm32 and arm64, Here we can convert the dsb with insteading of dsb(sy).The "sy" param is the default which you are allow to omit, so on arm32 dsb()and dsb(sy) are the same.

---
 drivers/clocksource/rockchip_timer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clocksource/rockchip_timer.c +4 -4
index d3c1742..724c321 100644
@@ -49,14 +49,14 @@ 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();
+	dsb(sy);
 }
 
 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();
+	dsb(sy);
 }
 
 static void rk_timer_update_counter(unsigned long cycles,
@@ -64,13 +64,13 @@ 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();
+	dsb(sy);
 }
 
 static void rk_timer_interrupt_clear(struct clock_event_device *ce)
 {
 	writel_relaxed(1, rk_base(ce) + TIMER_INT_STATUS);
-	dsb();
+	dsb(sy);
 }
 
 static inline int rk_timer_set_next_event(unsigned long cycles,
Signature · 1 line
1.9.1
#15 lore raw

PATCH 13/22 clocksource/drivers/vt8500: Remove unneeded header

In reply to Daniel Lezcano

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

---
 drivers/clocksource/vt8500_timer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/vt8500_timer.c +0 -1
index a92e94b..de49805 100644
@@ -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>
Signature · 1 line
1.9.1
#21 lore raw

PATCH 19/22 clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 arch/arm/mach-ux500/Kconfig | 1 +
 drivers/clocksource/Kconfig | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/mach-ux500/Kconfig +1 -0
index c9ac19b..5eacdd6 100644
@@ -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
drivers/clocksource/Kconfig +1 -3
index 17674b4..916c36d 100644
@@ -114,9 +114,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
 
Signature · 1 line
1.9.1
#24 lore raw

PATCH 20/22 clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -0
index 3a10f1a..ff10539 100644
@@ -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)
 
drivers/clocksource/Kconfig +2 -2
index 916c36d..d829cbe 100644
@@ -213,8 +213,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.
 
Signature · 1 line
1.9.1
#0 lore raw

PATCH 1/22 clocksource/drivers/pistachio: Add the COMPILE_TEST option

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 26f659e..a1c9312 100644
@@ -112,8 +112,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_STM32
 	bool "Clocksource for STM32 SoCs" if !ARCH_STM32
Signature · 1 line
1.9.1
#7 lore raw

PATCH 5/22 clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index 6f85622..0b5bdb4 100644
@@ -37,8 +37,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
Signature · 1 line
1.9.1
#8 lore raw

PATCH 6/22 clocksource/drivers/meson6: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 0b5bdb4..2c76c2d 100644
@@ -44,8 +44,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
Signature · 1 line
1.9.1
#12 lore raw

PATCH 10/22 clocksource/drivers/sun4i: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index a8afd8a..4c0daae 100644
@@ -62,8 +62,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
Signature · 1 line
1.9.1
#11 lore raw

PATCH 9/22 clocksource/drivers/dw_apb: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 5b0f63a..a8afd8a 100644
@@ -24,7 +24,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
Signature · 1 line
1.9.1
#14 lore raw

PATCH 12/22 clocksource/drivers/tegra2: Add the COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index 58dabd3..1af13c9 100644
@@ -75,7 +75,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
Signature · 1 line
1.9.1
#35 lore raw

PATCH 22/22 clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +1 -1
index 8f2a3fb..d199f48 100644
@@ -227,7 +227,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.
 
Signature · 1 line
1.9.1
#34 lore raw

PATCH 21/22 clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +1 -1
index d829cbe..8f2a3fb 100644
@@ -219,7 +219,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
Signature · 1 line
1.9.1
#20 lore raw

PATCH 18/22 clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/Kconfig +2 -2
index 31ba1c2..17674b4 100644
@@ -99,8 +99,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
Signature · 1 line
1.9.1
#19 lore raw

PATCH 17/22 clocksource/drivers/lpc32xx: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index f6a1c3e..31ba1c2 100644
@@ -137,9 +137,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
Signature · 1 line
1.9.1
#18 lore raw

PATCH 16/22 clocksource/drivers/asm9260: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index b631b14..f6a1c3e 100644
@@ -92,9 +92,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
Signature · 1 line
1.9.1
#17 lore raw

PATCH 15/22 clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index b0136fc..b631b14 100644
@@ -86,7 +86,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
Signature · 1 line
1.9.1
#16 lore raw

PATCH 14/22 clocksource/drivers/vt8500: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 1af13c9..b0136fc 100644
@@ -81,7 +81,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
Signature · 1 line
1.9.1
#13 lore raw

PATCH 11/22 clocksource/drivers/sun5i: Add the COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index 4c0daae..58dabd3 100644
@@ -68,8 +68,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
Signature · 1 line
1.9.1
#10 lore raw

PATCH 8/22 clocksource/drivers/digicolor: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Increase the compilation test coverage by adding the COMPILE_TEST option.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 8a80221..5b0f63a 100644
@@ -19,7 +19,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
Signature · 1 line
1.9.1
#9 lore raw

PATCH 7/22 clocksource/drivers/orion: Add the COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index 2c76c2d..8a80221 100644
@@ -50,9 +50,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
Signature · 1 line
1.9.1
#6 lore raw

PATCH 4/22 clocksource/drivers/rockchip: Add COMPILE_TEST option

In reply to Daniel Lezcano

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.

---
 drivers/clocksource/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +4 -1
index dc79fde..6f85622 100644
@@ -30,8 +30,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
Signature · 1 line
1.9.1
Acked-by on v1 19/22
#22 lore raw

Re: [PATCH 19/22] clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option

In reply to Daniel Lezcano
Quoted 10 lines · Daniel Lezcano

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.

Please merge this into the clksrc tree.

Yours,
Linus Walleij

#23 lore raw

Re: [PATCH 19/22] clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option

Quoted 12 lines · Linus Walleij
Quoted 9 lines · Daniel Lezcano

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.

Quoted 5 lines
Quoted 1 line

Please merge this into the clksrc tree.

Thanks for the review.

-- Daniel

Signature · 5 lines
  <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
#3 lore raw

Re: [PATCH 03/22] clocksource/drivers/rockchip: Make the driver more compatible

In reply to Daniel Lezcano
Quoted 6 lines · On Monday 02 November 2015 13:56:31 Daniel Lezcano wrote:

static inline void rk_timer_disable(struct clock_event_device *ce)

 {
        writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
drivers/clocksource/rockchip_timer.c +0 -1
-       dsb();

drivers/clocksource/rockchip_timer.c static inline void __iomem *rk_base(struct clock_event_device *ce) · line 60

Quoted 10 lines
drivers/clocksource/rockchip_timer.c +2 -1
+       dsb(sy);
 }
 
 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();
+       dsb(sy);
 }

This will fail the compile test, because dsb() is not available on non-ARM architectures. Would it be enough to just use the normal writel() accessor here?

Arnd

#4 lore raw

Re: [PATCH 03/22] clocksource/drivers/rockchip: Make the driver more compatible

Quoted 18 lines · Arnd Bergmann
Quoted 6 lines · On Monday 02 November 2015 13:56:31 Daniel Lezcano wrote:
  static inline void rk_timer_disable(struct clock_event_device *ce)
  {
         writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
drivers/clocksource/rockchip_timer.c +0 -1
-       dsb();

drivers/clocksource/rockchip_timer.c static inline void __iomem *rk_base(struct clock_event_device *ce) · line 60

Quoted 10 lines
drivers/clocksource/rockchip_timer.c +2 -1
+       dsb(sy);
  }
 
  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();
+       dsb(sy);
  }
Quoted 3 lines

This will fail the compile test, because dsb() is not available on non-ARM architectures. Would it be enough to just use the normal writel() accessor here?

That's a good question and I believe we can remove it but I have to setup a rockchip board before doing the changes in order to test.

I the meantime added the COMPILE_TEST option but restricted it to ARM and ARM64.

Signature · 5 lines
  <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
#5 lore raw

Re: [PATCH 03/22] clocksource/drivers/rockchip: Make the driver more compatible

Quoted 23 lines · On Monday 02 November 2015 17:32:22 Daniel Lezcano wrote:
Quoted 18 lines · Arnd Bergmann
Quoted 6 lines · On Monday 02 November 2015 13:56:31 Daniel Lezcano wrote:
  static inline void rk_timer_disable(struct clock_event_device *ce)
  {
         writel_relaxed(TIMER_DISABLE, rk_base(ce) + TIMER_CONTROL_REG);
drivers/clocksource/rockchip_timer.c +0 -1
-       dsb();

drivers/clocksource/rockchip_timer.c static inline void __iomem *rk_base(struct clock_event_device *ce) · line 60

Quoted 10 lines
drivers/clocksource/rockchip_timer.c +2 -1
+       dsb(sy);
  }
 
  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();
+       dsb(sy);
  }
Quoted 3 lines

This will fail the compile test, because dsb() is not available on non-ARM architectures. Would it be enough to just use the normal writel() accessor here?

Quoted 6 lines

That's a good question and I believe we can remove it but I have to setup a rockchip board before doing the changes in order to test.

I the meantime added the COMPILE_TEST option but restricted it to ARM and ARM64.

Ok. I saw that addition after commenting here, it looks correct this way, I was just slightly confused by seeing patch 2 first and thought it was for the same driver.

In general, it would of course be best to allow all drivers to be built on x86, but your series is already a huge improvement as it is.

Arnd

#25 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Daniel Lezcano
Quoted 2 lines · Daniel Lezcano

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

Selecting user-visible symbols is rather discouraged so why not something like this:

-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Best regards,
Krzysztof

Quoted 38 lines

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

---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -0
index 3a10f1a..ff10539 100644
@@ -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)
 
drivers/clocksource/Kconfig +2 -2
index 916c36d..d829cbe 100644
@@ -213,8 +213,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.
 
Reviewed-by on v1 20/22
#33 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Daniel Lezcano

Hi,

Quoted 30 lines · Daniel Lezcano

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.

---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -0
index 3a10f1a..ff10539 100644
@@ -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)
 
drivers/clocksource/Kconfig +0 -0
index 916c36d..d829cbe 100644

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC · line 220

Quoted 10 lines
drivers/clocksource/Kconfig +2 -2
@@ -213,8 +213,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.
 

Looks good to me. As you commented, delay_timer is only used on ARM 32bit. I'm glad to use the 'depends on ARM' instead of reverse dependency.

Thanks,
Chanwoo Choi

#26 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Krzysztof Kozlowski

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC

Quoted 11 lines · Krzysztof Kozlowski
Quoted 2 lines · Daniel Lezcano

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

Selecting user-visible symbols is rather discouraged so why not something like this:

drivers/clocksource/Kconfig +2 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Nope, that was wrong as we loose auto-select on Exynos. Instead:

-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver" if ARM
+       depends on ARCH_EXYNOS || COMPILE_TEST
+       default y if ARCH_EXYNOS

This way we avoid select (which is a reverse dependency for the driver), have it auto-selectable and compile tested on arm.

Best regards,
Krzysztof

Quoted 41 lines
Quoted 39 lines

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

---
 arch/arm/mach-exynos/Kconfig | 1 +
 drivers/clocksource/Kconfig  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -0
index 3a10f1a..ff10539 100644
@@ -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)
 
drivers/clocksource/Kconfig +2 -2
index 916c36d..d829cbe 100644
@@ -213,8 +213,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.
 
#27 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

Quoted 20 lines · Krzysztof Kozlowski

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC

Quoted 11 lines · Krzysztof Kozlowski
Quoted 2 lines · Daniel Lezcano

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

Selecting user-visible symbols is rather discouraged so why not something like this:

drivers/clocksource/Kconfig +2 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Nope, that was wrong as we loose auto-select on Exynos. Instead:

(quoted diff) +3 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver" if ARM
+       depends on ARCH_EXYNOS || COMPILE_TEST
+       default y if ARCH_EXYNOS
Quoted 2 lines

This way we avoid select (which is a reverse dependency for the driver), have it auto-selectable and compile tested on arm.

I think you misunderstood the patch I sent.

It does two things:

1. Follow the thumb of rule of the current Kconfig format

- The timer driver is selected by the platform (exynos in this case)
- User can't select the driver in the menuconfig
- There is no dependency on the platform except for compilation test

2. Add the COMPILE_TEST

- User can select the driver for compilation testing. This is for
allyesconfig when doing compilation test coverage (exynos timer could be compiled on other platform). As the delay code is not portable, we have to restrict the compilation on the ARM platform, this is why there is the dependency on ARM.

I am currently looking at splitting the delay code in order to prevent this restriction on this driver and some others drivers.

Quoted 40 lines
Quoted 39 lines
Quoted 37 lines

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

---
  arch/arm/mach-exynos/Kconfig | 1 +
  drivers/clocksource/Kconfig  | 4 ++--
  2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -0
index 3a10f1a..ff10539 100644
@@ -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)
 
drivers/clocksource/Kconfig +2 -2
index 916c36d..d829cbe 100644
@@ -213,8 +213,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.
 
Signature · 5 lines
  <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
#28 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

Quoted 36 lines · On Tuesday 03 November 2015 09:40:02 Daniel Lezcano wrote:
Quoted 20 lines · Krzysztof Kozlowski

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC

Quoted 11 lines · Krzysztof Kozlowski
Quoted 2 lines · Daniel Lezcano

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

Selecting user-visible symbols is rather discouraged so why not something like this:

drivers/clocksource/Kconfig +2 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Nope, that was wrong as we loose auto-select on Exynos. Instead:

(quoted diff) +3 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver" if ARM
+       depends on ARCH_EXYNOS || COMPILE_TEST
+       default y if ARCH_EXYNOS
Quoted 2 lines

This way we avoid select (which is a reverse dependency for the driver), have it auto-selectable and compile tested on arm.

I think you misunderstood the patch I sent.

It does two things:

1. Follow the thumb of rule of the current Kconfig format

- The timer driver is selected by the platform (exynos in this case)
- User can't select the driver in the menuconfig
- There is no dependency on the platform except for compilation test

2. Add the COMPILE_TEST

Quoted 8 lines

- User can select the driver for compilation testing. This is for
allyesconfig when doing compilation test coverage (exynos timer could be compiled on other platform). As the delay code is not portable, we have to restrict the compilation on the ARM platform, this is why there is the dependency on ARM.

I am currently looking at splitting the delay code in order to prevent this restriction on this driver and some others drivers.

I suspect this will come up again in the future. The problem is really that drivers/clocksource has different rules from almost everything else, by requiring the platform to 'select' the driver.

The second version that Krzysztof posted is how we handle this in other driver subsystems, and I would generally prefer it to do this consistently for everything, but John Stultz has in the past argued strongly for using 'select' in all clocksource drivers. The reason is that for each platform we know in advance which driver we want, and there is never a need for the user to have to select the right one.

Arnd

#29 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

Quoted 50 lines · Arnd Bergmann
Quoted 36 lines · On Tuesday 03 November 2015 09:40:02 Daniel Lezcano wrote:
Quoted 20 lines · Krzysztof Kozlowski

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC

Quoted 11 lines · Krzysztof Kozlowski
Quoted 2 lines · Daniel Lezcano

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

Selecting user-visible symbols is rather discouraged so why not something like this:

drivers/clocksource/Kconfig +2 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Nope, that was wrong as we loose auto-select on Exynos. Instead:

(quoted diff) +3 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver" if ARM
+       depends on ARCH_EXYNOS || COMPILE_TEST
+       default y if ARCH_EXYNOS
Quoted 2 lines

This way we avoid select (which is a reverse dependency for the driver), have it auto-selectable and compile tested on arm.

I think you misunderstood the patch I sent.

It does two things:

1. Follow the thumb of rule of the current Kconfig format

- The timer driver is selected by the platform (exynos in this case)
- User can't select the driver in the menuconfig
- There is no dependency on the platform except for compilation test

2. Add the COMPILE_TEST

Quoted 8 lines

- User can select the driver for compilation testing. This is for
allyesconfig when doing compilation test coverage (exynos timer could be compiled on other platform). As the delay code is not portable, we have to restrict the compilation on the ARM platform, this is why there is the dependency on ARM.

I am currently looking at splitting the delay code in order to prevent this restriction on this driver and some others drivers.

I suspect this will come up again in the future. The problem is really that drivers/clocksource has different rules from almost everything else, by requiring the platform to 'select' the driver.

Quoted 7 lines

The second version that Krzysztof posted is how we handle this in other driver subsystems, and I would generally prefer it to do this consistently for everything, but John Stultz has in the past argued strongly for using 'select' in all clocksource drivers. The reason is that for each platform we know in advance which driver we want, and there is never a need for the user to have to select the right one.

Yes, and I second John in this.

Signature · 5 lines
  <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
Tested-by Reviewed-by
#30 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Arnd Bergmann

W dniu 03.11.2015 o 19:02, Arnd Bergmann pisze:

Quoted 50 lines · On Tuesday 03 November 2015 09:40:02 Daniel Lezcano wrote:
Quoted 36 lines · Krzysztof Kozlowski
Quoted 20 lines · Krzysztof Kozlowski

drivers/clocksource/Kconfig config CLKSRC_METAG_GENERIC

Quoted 11 lines · Daniel Lezcano
Quoted 2 lines

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

Selecting user-visible symbols is rather discouraged so why not something like this:

drivers/clocksource/Kconfig +2 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver"
+       depends on ARCH_EXYNOS || (COMPILE_TEST && ARM)

Nope, that was wrong as we loose auto-select on Exynos. Instead:

(quoted diff) +3 -2
-       def_bool y if ARCH_EXYNOS
-       depends on !ARM64
+       bool "Exynos multi core timer driver" if ARM
+       depends on ARCH_EXYNOS || COMPILE_TEST
+       default y if ARCH_EXYNOS
Quoted 2 lines

This way we avoid select (which is a reverse dependency for the driver), have it auto-selectable and compile tested on arm.

I think you misunderstood the patch I sent.

It does two things:

1. Follow the thumb of rule of the current Kconfig format

- The timer driver is selected by the platform (exynos in this case)
- User can't select the driver in the menuconfig
- There is no dependency on the platform except for compilation test

2. Add the COMPILE_TEST

Quoted 8 lines

- User can select the driver for compilation testing. This is for
allyesconfig when doing compilation test coverage (exynos timer could be compiled on other platform). As the delay code is not portable, we have to restrict the compilation on the ARM platform, this is why there is the dependency on ARM.

I am currently looking at splitting the delay code in order to prevent this restriction on this driver and some others drivers.

I suspect this will come up again in the future. The problem is really that drivers/clocksource has different rules from almost everything else, by requiring the platform to 'select' the driver.

Quoted 7 lines

The second version that Krzysztof posted is how we handle this in other driver subsystems, and I would generally prefer it to do this consistently for everything, but John Stultz has in the past argued strongly for using 'select' in all clocksource drivers. The reason is that for each platform we know in advance which driver we want, and there is never a need for the user to have to select the right one.

Arnd, Daniel,

Sure, makes sense to me, thanks for explanation. Actually this makes me thinking that drivers/soc/* should probably follow the same convention... but not all of them do that.

Anyway the patch worked fine and with explanation I can only confirm:

Best regards,
Krzysztof

#31 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

Quoted 1 line · Krzysztof Kozlowski

Anyway the patch worked fine and with explanation I can only confirm:

Great ! Thanks Krzysztof for testing.

-- Daniel

Signature · 5 lines
  <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
#32 lore raw

Re: [PATCH 20/22] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option

In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

I suspect this will come up again in the future. The problem is really that drivers/clocksource has different rules from almost everything else, by requiring the platform to 'select' the driver.

The second version that Krzysztof posted is how we handle this in other driver subsystems, and I would generally prefer it to do this consistently for everything, but John Stultz has in the past argued strongly for using 'select' in all clocksource drivers. The reason is that for each platform we know in advance which driver we want, and there is never a need for the user to have to select the right one.

And just to clarify, I don't necessarily think "select" is the right method, as creating an option that defaults to Y if the right architecture/platform support is present is fine too.

I just don't want users to have to search deeply through menuconfig to find a clocksource driver checkbox when they have already selected a platform and provided enough information for us to know which clocksource driver is needed. So my argument its really all about avoiding user-prompts in kconfig for clocksources. It is conceptually easier to do this w/ select, but you can also do it via default y and proper dependencies.

thanks
-john