All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers/clocksource/pistachio: fix memory corruption in init
@ 2016-08-17 10:22 Marcin Nowakowski
  2016-08-17 10:22 ` [PATCH 2/2] drivers/clocksource/pistachio: improve register offset calculation Marcin Nowakowski
  2016-08-23 15:31 ` [PATCH 1/2] drivers/clocksource/pistachio: fix memory corruption in init Daniel Lezcano
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Nowakowski @ 2016-08-17 10:22 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, Marcin Nowakowski

Driver init code incorrectly uses the block base address and as a result
clears clocksource structure's fields instead of the hardware registers.

Commit 09a998201649 ("timekeeping: Lift clocksource cacheline
restriction") has changed the offsets within pistachio_clocksource
structure and what has previously gone unnoticed now leads to a kernel
panic during boot.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
 drivers/clocksource/time-pistachio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/time-pistachio.c b/drivers/clocksource/time-pistachio.c
index a7d9a08..a8e6c7d 100644
--- a/drivers/clocksource/time-pistachio.c
+++ b/drivers/clocksource/time-pistachio.c
@@ -202,10 +202,10 @@ static int __init pistachio_clksrc_of_init(struct device_node *node)
 	rate = clk_get_rate(fast_clk);
 
 	/* Disable irq's for clocksource usage */
-	gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 0);
-	gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 1);
-	gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 2);
-	gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 3);
+	gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 0);
+	gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 1);
+	gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 2);
+	gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 3);
 
 	/* Enable timer block */
 	writel(TIMER_ME_GLOBAL, pcs_gpt.base);
-- 
2.7.4

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

end of thread, other threads:[~2016-08-23 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17 10:22 [PATCH 1/2] drivers/clocksource/pistachio: fix memory corruption in init Marcin Nowakowski
2016-08-17 10:22 ` [PATCH 2/2] drivers/clocksource/pistachio: improve register offset calculation Marcin Nowakowski
2016-08-23 15:31 ` [PATCH 1/2] drivers/clocksource/pistachio: fix memory corruption in init 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.