Skip to contentSkip to conversation

: clockevents: 3.18 fixes

GIT PULL New Daniel Lezcano 1 participant 4 messages Jan 7, 2015

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

Hi Thomas,

this pull request provides three fixes for 3.18.

* Magnus Damn fixed the cpumask for the sh_tmu driver in order to make
it work on the SMP system

* Olof Johansson fixed the __iomem annotation to prevent a sparse warning

* Tobias Jakobi fixed the mct mask inversion which was introduced by
commit a1ba7a7a

Thanks !

-- Daniel

ps: happy new year ;)

The following changes since commit a5fd9733a30d18d7ac23f17080e7e07bb3205b69:

tick/powerclamp: Remove tick_nohz_idle abuse (2014-12-19 14:05:52 +0100)

are available in the git repository at:

http://git.linaro.org/people/daniel.lezcano/linux.git
clockevents/3.18-fixes

for you to fetch changes up to f2a5473861cf69c03d0f0ee5d0ea1b853b9e582e:

clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast
(2015-01-05 14:43:37 +0100)

----------------------------------------------------------------
Magnus Damm (1):
clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast

Olof Johansson (1):
clocksource: kona: fix __iomem annotation

Tobias Jakobi (1):
clocksource: exynos_mct: Fix bitmask regression for exynos4_mct_write

 drivers/clocksource/bcm_kona_timer.c | 9 ++++-----
 drivers/clocksource/exynos_mct.c     | 4 ++--
 drivers/clocksource/sh_tmu.c         | 2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)
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
#1 lore raw

PATCH 1/3 clocksource: exynos_mct: Fix bitmask regression for exynos4_mct_write

From: Tobias Jakobi <[email protected]>

EXYNOS4_MCT_L_MASK is defined as 0xffffff00, so applying this bitmask produces a number outside the range 0x00 to 0xff, which always results in execution of the default switch statement.

Obviously this is wrong and git history shows that the bitmask inversion was incorrectly set during a refactoring of the MCT code.

Fix this by putting the inversion at the correct position again.

---
 drivers/clocksource/exynos_mct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/exynos_mct.c +2 -2
index 9403061..83564c9 100644
@@ -97,8 +97,8 @@ static void exynos4_mct_write(unsigned int value, unsigned long offset)
 	writel_relaxed(value, reg_base + offset);
 
 	if (likely(offset >= EXYNOS4_MCT_L_BASE(0))) {
-		stat_addr = (offset & ~EXYNOS4_MCT_L_MASK) + MCT_L_WSTAT_OFFSET;
-		switch (offset & EXYNOS4_MCT_L_MASK) {
+		stat_addr = (offset & EXYNOS4_MCT_L_MASK) + MCT_L_WSTAT_OFFSET;
+		switch (offset & ~EXYNOS4_MCT_L_MASK) {
 		case MCT_L_TCON_OFFSET:
 			mask = 1 << 3;		/* L_TCON write status */
 			break;
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 clocksource: kona: fix __iomem annotation

From: Olof Johansson <[email protected]>

It makes no sense to hide the __iomem annotation from the function that uses it, especially since it causes a sparse warning:

drivers/clocksource/bcm_kona_timer.c:118:38: warning: incorrect type in argument 1 (different address spaces)
drivers/clocksource/bcm_kona_timer.c:118:38: expected void *timer_base
drivers/clocksource/bcm_kona_timer.c:118:38: got void [noderef] <asn:2>*static [toplevel] tmr_regs

---
 drivers/clocksource/bcm_kona_timer.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/clocksource/bcm_kona_timer.c +4 -5
index 0595dc6..f1e33d0 100644
@@ -68,9 +68,8 @@ static void kona_timer_disable_and_clear(void __iomem *base)
 }
 
 static void
-kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)
+kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
 {
-	void __iomem *base = IOMEM(timer_base);
 	int loop_limit = 4;
 
 	/*
@@ -86,9 +85,9 @@ kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)
 	 */
 
 	while (--loop_limit) {
-		*msw = readl(base + KONA_GPTIMER_STCHI_OFFSET);
-		*lsw = readl(base + KONA_GPTIMER_STCLO_OFFSET);
-		if (*msw == readl(base + KONA_GPTIMER_STCHI_OFFSET))
+		*msw = readl(timer_base + KONA_GPTIMER_STCHI_OFFSET);
+		*lsw = readl(timer_base + KONA_GPTIMER_STCLO_OFFSET);
+		if (*msw == readl(timer_base + KONA_GPTIMER_STCHI_OFFSET))
 			break;
 	}
 	if (!loop_limit) {
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast

In reply to Daniel Lezcano

From: Magnus Damm <[email protected]>

Update the TMU driver to use cpu_possible_mask as cpumask to make r8a7779 SMP work as expected with or without the ARM TWD timer.

---
 drivers/clocksource/sh_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/sh_tmu.c +1 -1
index 0f665b8..f150ca82 100644
@@ -428,7 +428,7 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
 	ced->features = CLOCK_EVT_FEAT_PERIODIC;
 	ced->features |= CLOCK_EVT_FEAT_ONESHOT;
 	ced->rating = 200;
-	ced->cpumask = cpumask_of(0);
+	ced->cpumask = cpu_possible_mask;
 	ced->set_next_event = sh_tmu_clock_event_next;
 	ced->set_mode = sh_tmu_clock_event_mode;
 	ced->suspend = sh_tmu_clock_event_suspend;
Signature · 1 line
1.9.1