Skip to contentSkip to conversation

clocksource: sh_cmt: Fix !HAS_IOMEM build

PATCH New Daniel Lezcano 2 participants 6 messages Mar 26, 2015 1 message not in the archive

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

PATCH 1/4 clocksource: sh_cmt: Fix !HAS_IOMEM build

In reply to a message not in the archive

From: Richard Weinberger <[email protected]>

Fixes:
drivers/clocksource/sh_cmt.c: In function ‘sh_cmt_map_memory’:
drivers/clocksource/sh_cmt.c:920:2: error: implicit declaration of function ‘ioremap_nocache’ [-Werror=implicit-function-declaration]
cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
^
drivers/clocksource/sh_cmt.c:920:15: warning: assignment makes pointer from integer without a cast [enabled by default]

  cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
               ^

drivers/clocksource/sh_cmt.c: In function ‘sh_cmt_setup’:
drivers/clocksource/sh_cmt.c:1034:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]
iounmap(cmt->mapbase);

---
 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/clocksource/Kconfig +1 -0
index 68161f7..c948f4e 100644
@@ -192,6 +192,7 @@ config SYS_SUPPORTS_EM_STI
 config SH_TIMER_CMT
 	bool "Renesas CMT timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_CMT
 	help
 	  This enables build of a clocksource and clockevent driver for
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 clocksource: sh_tmu: Fix !HAS_IOMEM build

From: Richard Weinberger <[email protected]>

Fixes:
drivers/clocksource/sh_tmu.c: In function ‘sh_tmu_map_memory’:
drivers/clocksource/sh_tmu.c:506:2: error: implicit declaration of function ‘ioremap_nocache’ [-Werror=implicit-function-declaration]
tmu->mapbase = ioremap_nocache(res->start, resource_size(res));
^
drivers/clocksource/sh_tmu.c:506:15: warning: assignment makes pointer from integer without a cast [enabled by default]

  tmu->mapbase = ioremap_nocache(res->start, resource_size(res));
               ^

drivers/clocksource/sh_tmu.c: In function ‘sh_tmu_setup’:
drivers/clocksource/sh_tmu.c:598:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]
iounmap(tmu->mapbase);

---
 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/clocksource/Kconfig +1 -0
index c4063a6..a0b036c 100644
@@ -212,6 +212,7 @@ config SH_TIMER_MTU2
 config SH_TIMER_TMU
 	bool "Renesas TMU timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_TMU
 	help
 	  This enables build of a clocksource and clockevent driver for
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 clocksource: sh_mtu2: Fix !HAS_IOMEM build

In reply to Daniel Lezcano

From: Richard Weinberger <[email protected]>

Fixes:
drivers/clocksource/sh_mtu2.c: In function ‘sh_mtu2_map_memory’:
drivers/clocksource/sh_mtu2.c:391:2: error: implicit declaration of function ‘ioremap_nocache’ [-Werror=implicit-function-declaration]
mtu->mapbase = ioremap_nocache(res->start, resource_size(res));
^
drivers/clocksource/sh_mtu2.c:391:15: warning: assignment makes pointer from integer without a cast [enabled by default]

  mtu->mapbase = ioremap_nocache(res->start, resource_size(res));
               ^

drivers/clocksource/sh_mtu2.c: In function ‘sh_mtu2_setup’:
drivers/clocksource/sh_mtu2.c:448:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]
iounmap(mtu->mapbase);

---
 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/clocksource/Kconfig +1 -0
index c948f4e..c4063a6 100644
@@ -202,6 +202,7 @@ config SH_TIMER_CMT
 config SH_TIMER_MTU2
 	bool "Renesas MTU2 timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_MTU2
 	help
 	  This enables build of a clockevent driver for the Multi-Function
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/4 clocksource: sun5i: Fix cpufreq interaction with sched_clock

In reply to Daniel Lezcano

From: Maxime Ripard <[email protected]>

The sched_clock we use on some system is this timer, and since we started using cpufreq, the cpu clock (that is one of the timer's clock indirect parent) now changes, along with the actual sched_clock rate. We can safely remove the sched_clock on those systems, since we have other reliable sched_clock in the system.

---
 drivers/clocksource/timer-sun5i.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/clocksource/timer-sun5i.c +0 -7
index 5dcbf90..58597fb 100644
@@ -17,7 +17,6 @@
 #include <linux/irq.h>
 #include <linux/irqreturn.h>
 #include <linux/reset.h>
-#include <linux/sched_clock.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -137,11 +136,6 @@ static struct irqaction sun5i_timer_irq = {
 	.dev_id = &sun5i_clockevent,
 };
 
-static u64 sun5i_timer_sched_read(void)
-{
-	return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1));
-}
-
 static void __init sun5i_timer_init(struct device_node *node)
 {
 	struct reset_control *rstc;
@@ -172,7 +166,6 @@ static void __init sun5i_timer_init(struct device_node *node)
 	writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
 	       timer_base + TIMER_CTL_REG(1));
 
-	sched_clock_register(sun5i_timer_sched_read, 32, rate);
 	clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name,
 			      rate, 340, 32, clocksource_mmio_readl_down);
 
Signature · 1 line
1.9.1
#6 lore raw

[tip:timers/urgent] clocksource/drivers: Fix various !CONFIG_HAS_IOMEM build errors

In reply to Daniel Lezcano
clocksource/drivers: Fix various !CONFIG_HAS_IOMEM build errors
Commit-ID:  11bc26fe372fa6da81c82c68f755d2795838a640
Gitweb:     http://git.kernel.org/tip/11bc26fe372fa6da81c82c68f755d2795838a640
Author:     Richard Weinberger <[email protected]>
AuthorDate: Thu, 26 Mar 2015 10:27:06 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 26 Mar 2015 10:59:40 +0100

clocksource/drivers: Fix various !CONFIG_HAS_IOMEM build errors

Fix !CONFIG_HAS_IOMEM related build failures in three clocksource drivers.

The build failures have the pattern of:

drivers/clocksource/sh_cmt.c: In function ‘sh_cmt_map_memory’: drivers/clocksource/sh_cmt.c:920:2:
error: implicit declaration of function ‘ioremap_nocache’ [-Werror=implicit-function-declaration] cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));

---
 drivers/clocksource/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
drivers/clocksource/Kconfig +3 -0
index 68161f7..a0b036c 100644
@@ -192,6 +192,7 @@ config SYS_SUPPORTS_EM_STI
 config SH_TIMER_CMT
 	bool "Renesas CMT timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_CMT
 	help
 	  This enables build of a clocksource and clockevent driver for
@@ -201,6 +202,7 @@ config SH_TIMER_CMT
 config SH_TIMER_MTU2
 	bool "Renesas MTU2 timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_MTU2
 	help
 	  This enables build of a clockevent driver for the Multi-Function
@@ -210,6 +212,7 @@ config SH_TIMER_MTU2
 config SH_TIMER_TMU
 	bool "Renesas TMU timer driver" if COMPILE_TEST
 	depends on GENERIC_CLOCKEVENTS
+	depends on HAS_IOMEM
 	default SYS_SUPPORTS_SH_TMU
 	help
 	  This enables build of a clocksource and clockevent driver for
#5 lore raw

[tip:timers/urgent] clocksource/drivers/sun5i: Fix cpufreq interaction with sched_clock()

In reply to Daniel Lezcano
clocksource/drivers/sun5i: Fix cpufreq interaction with sched_clock()
Commit-ID:  6e206020324c50a95486f6b279a53512febed92d
Gitweb:     http://git.kernel.org/tip/6e206020324c50a95486f6b279a53512febed92d
Author:     Maxime Ripard <[email protected]>
AuthorDate: Thu, 26 Mar 2015 10:27:09 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 26 Mar 2015 10:59:40 +0100

clocksource/drivers/sun5i: Fix cpufreq interaction with sched_clock()

The sun5i timer is used as the sched-clock on certain systems, and ever since we started using cpufreq, the cpu clock (that is one of the timer's clock indirect parent) now changes as well, along with the actual sched_clock() rate.

This is not accurate and not desirable.

We can safely remove the sun5i sched-clock on those systems, since we have other reliable sched_clock() sources in the system.

---
 drivers/clocksource/timer-sun5i.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/clocksource/timer-sun5i.c +0 -7
index 5dcbf90..58597fb 100644
@@ -17,7 +17,6 @@
 #include <linux/irq.h>
 #include <linux/irqreturn.h>
 #include <linux/reset.h>
-#include <linux/sched_clock.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -137,11 +136,6 @@ static struct irqaction sun5i_timer_irq = {
 	.dev_id = &sun5i_clockevent,
 };
 
-static u64 sun5i_timer_sched_read(void)
-{
-	return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1));
-}
-
 static void __init sun5i_timer_init(struct device_node *node)
 {
 	struct reset_control *rstc;
@@ -172,7 +166,6 @@ static void __init sun5i_timer_init(struct device_node *node)
 	writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
 	       timer_base + TIMER_CTL_REG(1));
 
-	sched_clock_register(sun5i_timer_sched_read, 32, rate);
 	clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name,
 			      rate, 340, 32, clocksource_mmio_readl_down);