All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource: exynos_mct: fix exynos4_mct_write
@ 2014-10-22  1:37 Tobias Jakobi
  2014-10-22 15:57 ` Doug Anderson
  2014-11-29 22:18 ` Kukjin Kim
  0 siblings, 2 replies; 8+ messages in thread
From: Tobias Jakobi @ 2014-10-22  1:37 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: dianders, Tobias Jakobi

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.

Reported-by: GP Orcullo <kinsamanka@gmail.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/clocksource/exynos_mct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 9403061..83564c9 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -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;
-- 
2.0.4

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

end of thread, other threads:[~2014-12-02 15:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22  1:37 [PATCH] clocksource: exynos_mct: fix exynos4_mct_write Tobias Jakobi
2014-10-22 15:57 ` Doug Anderson
2014-10-22 16:12   ` Tobias Jakobi
2014-10-22 18:00     ` Chirantan Ekbote
2014-11-29 15:42       ` Tobias Jakobi
2014-11-29 22:14         ` Kukjin Kim
2014-11-29 22:18 ` Kukjin Kim
2014-12-02 15:21   ` 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.