From: Wolfgang Denk Date: Thu, 19 Mar 2020 10:10:11 +0100 Subject: [PATCH v2] powerpc: allow opting out of WATCHDOG_RESET() from timer interrupt In-Reply-To: <20200318151651.2510-1-rasmus.villemoes@prevas.dk> References: <20200316211551.30042-1-rasmus.villemoes@prevas.dk> <20200318151651.2510-1-rasmus.villemoes@prevas.dk> Message-ID: <20200319091011.8833C24003E@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Rasmus Villemoes, In message <20200318151651.2510-1-rasmus.villemoes@prevas.dk> you wrote: > When using CONFIG_(SPL_)WDT, the watchdog_reset function is a lot more > complicated than just poking a few SOC-specific registers - it > involves accessing all kinds of global data, and if the interrupt > happens at the wrong time (say, in the middle of an WATCHDOG_RESET() > call from ordinary code), that can end up corrupting said global data. > > Also, having WATCHDOG_RESET() called automatically from the timer > interrupt runs counter to the idea of a watchdog device - if the board > runs into an infinite loops with interrupts still enabled, the > watchdog will never fire. > > Allow the board to opt out of this behaviour by setting > CONFIG_SYS_WATCHDOG_FREQ to 0 - as that setting is currently > nonsensical, it cannot affect any existing boards. > > Signed-off-by: Rasmus Villemoes If such a change gets implemented, it should at least be made consistently, i. e. not only in arch/powerpc/lib/interrupts.c but also in the timer_interrupt() handler in drivers/timer/mpc83xx_timer.c and in dtimer_interrupt() in arch/m68k/lib/time.c and wherever else similar code may exist. Only changing one plase is not a good idea. And please add some documentation also to the README. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Our OS who art in CPU, UNIX be thy name. Thy programs run, thy syscalls done, In kernel as it is in user!