From: Rasmus Villemoes Date: Mon, 16 Mar 2020 16:52:06 +0100 Subject: [PATCH 0/3] watchdog: honour hw_margin_ms property In-Reply-To: <296630eb-e529-6abf-0e8c-92644827c2ca@denx.de> References: <39e2b876-6ba1-59b6-4ddd-068e120f9b4e@denx.de> <20200313160458.19727-1-rasmus.villemoes@prevas.dk> <296630eb-e529-6abf-0e8c-92644827c2ca@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 14/03/2020 13.04, Stefan Roese wrote: > On 13.03.20 17:04, Rasmus Villemoes wrote: >> That at least solves half my problems and >> might be useful to others as well. Then I'll have to figure out the >> time-stands-still problem in some other way. > > If its too hard to enable interrupts in SPL for you or to provide some > other means of a working get_timer() API, then we needto find another > solution. You started with this weak function, which of course works. > What other options are there? Adding a callback mechanism to register > platform specific callback functions? Even though this might get a > little bit too complicated. Now that I dig a bit more into this, I seem to remember that we actually also had problems in U-Boot proper when loading a compressed kernel, so for now we're using an uncompressed kernel in our FIT images. I will have to re-investigate, but it now occurs to me that it might be due to the fact that interrupts get disabled during bootm (which makes sense, the same reason I stated previously of interrupt vectors about to be overwritten), so even in U-Boot proper, time as measured by get_timer() ceases to pass after that point, so all the WATCHDOG_RESET() calls from the inflate code effectively get ignored. So it may be necessary to have some wdt_ratelimit_disable() hook that can be called from bootm_disable_interrupts() and e.g. some board-specific SPL code. I'll do some experiments and figure out if I do indeed need such a hook. Rasmus