Skip to contentSkip to conversation

clk: Add missing clk_get_sys() stub

PATCH In review Daniel Lezcano 3 participants 10 messages Jun 2, 2016 – Jun 20, 2016

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 clk: Add missing clk_get_sys() stub

When compiling with the COMPILE_TEST option set, the clps711x does not compile because of the clk_get_sys() noop stub missing.

---
 include/linux/clk.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/clk.h +4 -0
index 0df4a51..834179f 100644
@@ -461,6 +461,10 @@ static inline struct clk *clk_get_parent(struct clk *clk)
 	return NULL;
 }
 
+static inline struct clk *clk_get_sys(const char *dev_id, const char *con_id)
+{
+	return NULL;
+}
 #endif
 
 /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/6 clocksource/drivers/bcm_kona: Remove useless header <asm/mach/time.h>

The driver includes the <asm/mach/time.h> header but it is pointless.

Remove it.

---
 drivers/clocksource/bcm_kona_timer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/bcm_kona_timer.c +0 -1
index e717e87..fd11d59 100644
@@ -20,7 +20,6 @@
 #include <linux/clk.h>
 
 #include <linux/io.h>
-#include <asm/mach/time.h>
 
 #include <linux/of.h>
 #include <linux/of_address.h>
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/6 clocksource/drivers/bcm2835: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Change the Kconfig option logic to fullfil with the current approach.

A new Kconfig option is added, CONFIG_BCM2835_TIMER and is selected by the platform. Then the clocksource's Kconfig is changed to make this option selectable by the user if the COMPILE_TEST option is set. Otherwise, it is up to the platform's Kconfig to select the timer.

---
 arch/arm/mach-bcm/Kconfig    | 1 +
 drivers/clocksource/Kconfig  | 7 +++++++
 drivers/clocksource/Makefile | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
arch/arm/mach-bcm/Kconfig +1 -0
index 7ef1214..b7414df 100644
@@ -143,6 +143,7 @@ config ARCH_BCM2835
 	select ARM_TIMER_SP804
 	select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
 	select CLKSRC_OF
+	select BCM2835_TIMER
 	select PINCTRL
 	select PINCTRL_BCM2835
 	help
drivers/clocksource/Kconfig +7 -0
index 6ff327a..34053ab 100644
@@ -27,6 +27,13 @@ config CLKBLD_I8253
 config CLKSRC_MMIO
 	bool
 
+config BCM2835_TIMER
+	bool "BCM2835 timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
+	select CLKSRC_MMIO
+	help
+	  Enables the support for the BCM2835 timer driver.
+
 config DIGICOLOR_TIMER
 	bool "Digicolor timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
drivers/clocksource/Makefile +1 -1
index b0a3c96..6e278d4 100644
@@ -19,7 +19,7 @@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU)	+= nomadik-mtu.o
 obj-$(CONFIG_CLKSRC_DBX500_PRCMU)	+= clksrc-dbx500-prcmu.o
 obj-$(CONFIG_ARMADA_370_XP_TIMER)	+= time-armada-370-xp.o
 obj-$(CONFIG_ORION_TIMER)	+= time-orion.o
-obj-$(CONFIG_ARCH_BCM2835)	+= bcm2835_timer.o
+obj-$(CONFIG_BCM2835_TIMER)	+= bcm2835_timer.o
 obj-$(CONFIG_ARCH_CLPS711X)	+= clps711x-timer.o
 obj-$(CONFIG_ARCH_ATLAS7)	+= timer-atlas7.o
 obj-$(CONFIG_ARCH_MOXART)	+= moxart_timer.o
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/6 clocksource/drivers/armv7m_systick: Add the COMPILE_TEST option

In reply to Daniel Lezcano

In order to increase the compilation test coverage, add the COMPILE_TEST so the driver can be compiled even if it does not belong to the platform or the architecture.

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +1 -1
index 34053ab..a1e0cf9 100644
@@ -240,7 +240,7 @@ config CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
 	 Use ARM global timer clock source as sched_clock
 
 config ARMV7M_SYSTICK
-	bool
+	bool "Support for the ARMv7M system time" if COMPILE_TEST
 	select CLKSRC_OF if OF
 	select CLKSRC_MMIO
 	help
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 4/6] clocksource/drivers/armv7m_systick: Add the COMPILE_TEST option

url: https://github.com/0day-ci/linux/commits/Daniel-Lezcano/clk-Add-missing-clk_get_sys-stub/20160603-054643 config: um-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.1.1-1) 6.1.1…

Hi,

[auto build test ERROR on tip/timers/core]
[also build test ERROR on v4.7-rc1 next-20160602]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Daniel-Lezcano/clk-Add-missing-clk_get_sys-stub/20160603-054643
config: um-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430 reproduce:

        # save the attached .config to linux build tree
        make ARCH=um 

All errors (new ones prefixed by >>):

drivers/clocksource/armv7m_systick.c: In function 'system_timer_of_register':

>> drivers/clocksource/armv7m_systick.c:74:2: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
     iounmap(base);
     ^~~~~~~

cc1: some warnings being treated as errors

vim +/iounmap +74 drivers/clocksource/armv7m_systick.c

4958ebb3 Maxime Coquelin 2015-05-09  58  		pr_err("failed to init clocksource (%d)\n", ret);
4958ebb3 Maxime Coquelin 2015-05-09  59  		if (clk)
4958ebb3 Maxime Coquelin 2015-05-09  60  			goto out_clk_disable;
4958ebb3 Maxime Coquelin 2015-05-09  61  		else
4958ebb3 Maxime Coquelin 2015-05-09  62  			goto out_unmap;
4958ebb3 Maxime Coquelin 2015-05-09  63  	}
4958ebb3 Maxime Coquelin 2015-05-09  64  
4958ebb3 Maxime Coquelin 2015-05-09  65  	pr_info("ARM System timer initialized as clocksource\n");
4958ebb3 Maxime Coquelin 2015-05-09  66  
4958ebb3 Maxime Coquelin 2015-05-09  67  	return;
4958ebb3 Maxime Coquelin 2015-05-09  68  
4958ebb3 Maxime Coquelin 2015-05-09  69  out_clk_disable:
4958ebb3 Maxime Coquelin 2015-05-09  70  	clk_disable_unprepare(clk);
4958ebb3 Maxime Coquelin 2015-05-09  71  out_clk_put:
4958ebb3 Maxime Coquelin 2015-05-09  72  	clk_put(clk);
4958ebb3 Maxime Coquelin 2015-05-09  73  out_unmap:
4958ebb3 Maxime Coquelin 2015-05-09 @74  	iounmap(base);
4958ebb3 Maxime Coquelin 2015-05-09  75  	pr_warn("ARM System timer register failed (%d)\n", ret);
4958ebb3 Maxime Coquelin 2015-05-09  76  }
4958ebb3 Maxime Coquelin 2015-05-09  77  
4958ebb3 Maxime Coquelin 2015-05-09  78  CLOCKSOURCE_OF_DECLARE(arm_systick, "arm,armv7m-systick",
4958ebb3 Maxime Coquelin 2015-05-09  79  			system_timer_of_register);

:::::: The code at line 74 was first introduced by commit
:::::: 4958ebb3d027886c46b936453745dba59b09c578 clocksource/drivers/armv7m_systick: Add ARM System timer driver

:::::: TO: Maxime Coquelin <[email protected]> :::::: CC: Daniel Lezcano <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#5 lore raw

PATCH 5/6 clocksource/drivers/bcm_kona: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Change the Kconfig option logic to fullfil with the current approach.

A new Kconfig option is added, CONFIG_BCM_KONA_TIMER and is selected by the platform. Then the clocksource's Kconfig is changed to make this option selectable by the user if the COMPILE_TEST option is set. Otherwise, it is up to the platform's Kconfig to select the timer.

The timer uses <asm/mach/time.h>, which is now only for ARM, so this driver will depend on ARM.

---
 arch/arm/mach-bcm/Kconfig    | 1 +
 drivers/clocksource/Kconfig  | 7 +++++++
 drivers/clocksource/Makefile | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
arch/arm/mach-bcm/Kconfig +1 -0
index b7414df..e32ef5b 100644
@@ -89,6 +89,7 @@ config ARCH_BCM_MOBILE
 	select HAVE_ARM_ARCH_TIMER
 	select PINCTRL
 	select ARCH_BCM_MOBILE_SMP if SMP
+	select BCM_KONA_TIMER
 	help
 	  This enables support for systems based on Broadcom mobile SoCs.
 
drivers/clocksource/Kconfig +7 -0
index a1e0cf9..6714a22 100644
@@ -34,6 +34,13 @@ config BCM2835_TIMER
 	help
 	  Enables the support for the BCM2835 timer driver.
 
+config BCM_KONA_TIMER
+	bool "BCM mobile timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
+	select CLKSRC_MMIO
+	help
+	  Enables the support for the BCM Kona mobile timer driver.
+
 config DIGICOLOR_TIMER
 	bool "Digicolor timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
drivers/clocksource/Makefile +1 -1
index 6e278d4..662a87c 100644
@@ -33,7 +33,7 @@ obj-$(CONFIG_MESON6_TIMER)	+= meson6_timer.o
 obj-$(CONFIG_TEGRA_TIMER)	+= tegra20_timer.o
 obj-$(CONFIG_VT8500_TIMER)	+= vt8500_timer.o
 obj-$(CONFIG_ARCH_NSPIRE)	+= zevio-timer.o
-obj-$(CONFIG_ARCH_BCM_MOBILE)	+= bcm_kona_timer.o
+obj-$(CONFIG_BCM_KONA_TIMER)	+= bcm_kona_timer.o
 obj-$(CONFIG_CADENCE_TTC_TIMER)	+= cadence_ttc_timer.o
 obj-$(CONFIG_CLKSRC_EFM32)	+= time-efm32.o
 obj-$(CONFIG_CLKSRC_STM32)	+= timer-stm32.o
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/6 clocksource/drivers/clps_711x: Add the COMPILE_TEST option

In reply to Daniel Lezcano

Change the Kconfig option logic to fullfil with the current approach.

A new Kconfig option is added, CONFIG_BCM_KONA_TIMER and is selected by the platform. Then the clocksource's Kconfig is changed to make this option selectable by the user if the COMPILE_TEST option is set. Otherwise, it is up to the platform's Kconfig to select the timer.

---
 arch/arm/Kconfig             | 2 +-
 drivers/clocksource/Kconfig  | 7 +++++++
 drivers/clocksource/Makefile | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/Kconfig +1 -1
index cdfa6c2..0c1f546 100644
@@ -356,10 +356,10 @@ config ARCH_CLPS711X
 	bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 	select ARCH_REQUIRE_GPIOLIB
 	select AUTO_ZRELADDR
-	select CLKSRC_MMIO
 	select COMMON_CLK
 	select CPU_ARM720T
 	select GENERIC_CLOCKEVENTS
+	select CLPS711X_TIMER
 	select MFD_SYSCON
 	select SOC_BUS
 	help
drivers/clocksource/Kconfig +7 -0
index 6714a22..e92a814 100644
@@ -155,6 +155,13 @@ config CLKSRC_DBX500_PRCMU
 	help
 	  Use the always on PRCMU Timer as clocksource
 
+config CLPS711X_TIMER
+	bool "Cirrus logic timer driver" if COMPILE_TEST
+	depends on GENERIC_CLOCKEVENTS
+	select CLKSRC_MMIO
+	help
+	  Enables support for the Cirrus Logic PS711 timer.
+
 config CLKSRC_DBX500_PRCMU_SCHED_CLOCK
 	bool "Clocksource PRCMU Timer sched_clock"
 	depends on (CLKSRC_DBX500_PRCMU && !CLKSRC_NOMADIK_MTU_SCHED_CLOCK)
drivers/clocksource/Makefile +1 -1
index 662a87c..ae6c09f 100644
@@ -20,7 +20,7 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU)	+= clksrc-dbx500-prcmu.o
 obj-$(CONFIG_ARMADA_370_XP_TIMER)	+= time-armada-370-xp.o
 obj-$(CONFIG_ORION_TIMER)	+= time-orion.o
 obj-$(CONFIG_BCM2835_TIMER)	+= bcm2835_timer.o
-obj-$(CONFIG_ARCH_CLPS711X)	+= clps711x-timer.o
+obj-$(CONFIG_CLPS711X_TIMER)	+= clps711x-timer.o
 obj-$(CONFIG_ARCH_ATLAS7)	+= timer-atlas7.o
 obj-$(CONFIG_ARCH_MOXART)	+= moxart_timer.o
 obj-$(CONFIG_ARCH_MXS)		+= mxs_timer.o
Signature · 1 line
1.9.1
#7 lore raw
In reply to Daniel Lezcano
Quoted 4 lines · Daniel Lezcano

When compiling with the COMPILE_TEST option set, the clps711x does not compile because of the clk_get_sys() noop stub missing.

Added missing Cc [Mike and Stephen]

Quoted 20 lines
---
  include/linux/clk.h | 4 ++++
  1 file changed, 4 insertions(+)
include/linux/clk.h +4 -0
index 0df4a51..834179f 100644
@@ -461,6 +461,10 @@ static inline struct clk *clk_get_parent(struct clk *clk)
  	return NULL;
  }
 
+static inline struct clk *clk_get_sys(const char *dev_id, const char *con_id)
+{
+	return NULL;
+}
  #endif
 
  /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
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
#8 lore raw
In reply to Daniel Lezcano
Quoted 5 lines · Daniel Lezcano

When compiling with the COMPILE_TEST option set, the clps711x does not compile because of the clk_get_sys() noop stub missing.

---

Hi,

is this patch fine ? Can I pick it through my tree ?

Thanks.

-- Daniel

Quoted 19 lines
  include/linux/clk.h | 4 ++++
  1 file changed, 4 insertions(+)
include/linux/clk.h +4 -0
index 0df4a51..834179f 100644
@@ -461,6 +461,10 @@ static inline struct clk *clk_get_parent(struct clk *clk)
  	return NULL;
  }
 
+static inline struct clk *clk_get_sys(const char *dev_id, const char *con_id)
+{
+	return NULL;
+}
  #endif
 
  /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
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
Reviewed-by on v1 1/6
#9 lore raw
In reply to Daniel Lezcano

Hi Daniel,

Quoting Daniel Lezcano (2016-06-02 14:41:32)

Quoted 5 lines

When compiling with the COMPILE_TEST option set, the clps711x does not compile because of the clk_get_sys() noop stub missing.
=

This looks OK to me. Russell maintains clkdev and the clk.h stuff, so it would be good to get his ack. Please feel free to add:

Regards,
Mike

include/linux/clk.h static inline struct clk *clk_get_parent(struct clk =

Quoted 10 lines
---
 include/linux/clk.h | 4 ++++
 1 file changed, 4 insertions(+)

=

include/linux/clk.h +0 -0
index 0df4a51..834179f 100644
@@ -461,6 +461,10 @@ static inline struct clk *clk_get_parent(struct clk =

*clk)

include/linux/clk.h static inline struct clk *clk_get_parent(struct clk *clk)

Quoted 5 lines
include/linux/clk.h +1 -0
        return NULL;
 }
 =
 
+static inline struct clk *clk_get_sys(const char *dev_id, const char *co=

n_id)

Quoted 7 lines
include/linux/clk.h +3 -0
+{
+       return NULL;
+}
 #endif
 =

/* clk_prepare_enable helps cases using clk_enable in non-atomic context=

. */

Quoted 4 lines

-- =

1.9.1
=20