diff options
author | Tobias Jakobi <[email protected]> | 2014-10-22 03:37:08 +0200 |
---|---|---|
committer | Daniel Lezcano <[email protected]> | 2015-01-05 14:43:35 +0100 |
commit | 8c38d28ba8da98f7102c31d35359b4dbe9d1f329 (patch) | |
tree | de16aa7600fca8459412fea0e7d4b1bbb0756074 | |
parent | a5fd9733a30d18d7ac23f17080e7e07bb3205b69 (diff) |
clocksource: exynos_mct: Fix bitmask regression for exynos4_mct_write
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.
Cc: [email protected]
Acked-by: Kukjin Kim <[email protected]>
Reported-by: GP Orcullo <[email protected]>
Reviewed-by: Doug Anderson <[email protected]>
Signed-off-by: Tobias Jakobi <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
-rw-r--r-- | drivers/clocksource/exynos_mct.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 9403061a2acc..83564c9cfdbe 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; |