public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_, }WATCHDOG
@ 2020-03-20 10:52 Rasmus Villemoes
  2020-03-20 10:52 ` [PATCH v3 2/2] allow opting out of WATCHDOG_RESET() from timer interrupt Rasmus Villemoes
  2020-03-20 11:22 ` [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_, }WATCHDOG Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2020-03-20 10:52 UTC (permalink / raw)
  To: u-boot

The code, which is likely copied from arch/powerpc/lib/interrupts.c,
lacks a fallback definition of CONFIG_SYS_WATCHDOG_FREQ and refers to
a non-existing timestamp variable - obviously priv->timestamp is
meant.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 drivers/timer/mpc83xx_timer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c
index 72cb58b693..da516c9d74 100644
--- a/drivers/timer/mpc83xx_timer.c
+++ b/drivers/timer/mpc83xx_timer.c
@@ -16,6 +16,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SYS_WATCHDOG_FREQ
+#define CONFIG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2)
+#endif
+
 /**
  * struct mpc83xx_timer_priv - Private data structure for MPC83xx timer driver
  * @decrementer_count: Value to which the decrementer register should be re-set
@@ -167,7 +171,7 @@ void timer_interrupt(struct pt_regs *regs)
 	priv->timestamp++;
 
 #if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
-	if ((timestamp % (CONFIG_SYS_WATCHDOG_FREQ)) == 0)
+	if ((priv->timestamp % (CONFIG_SYS_WATCHDOG_FREQ)) == 0)
 		WATCHDOG_RESET();
 #endif    /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
 
-- 
2.23.0

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

end of thread, other threads:[~2020-05-04  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-20 10:52 [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_, }WATCHDOG Rasmus Villemoes
2020-03-20 10:52 ` [PATCH v3 2/2] allow opting out of WATCHDOG_RESET() from timer interrupt Rasmus Villemoes
2020-03-20 11:22 ` [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_, }WATCHDOG Wolfgang Denk
2020-05-04  8:10   ` [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_,}WATCHDOG Rasmus Villemoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox