mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Jules Maselbas <jmaselbas@kalray.eu>, barebox@lists.infradead.org
Cc: Clement Leger <clement.leger@bootlin.com>,
	Louis Morhet <lmorhet@kalray.eu>, Luc Michel <lmichel@kalray.eu>,
	Yann Sionneau <ysionneau@kalray.eu>
Subject: Re: [PATCH v2 07/11] watchdog: kvx: do not disable watchdog on probe
Date: Wed, 19 Jan 2022 15:25:57 +0100	[thread overview]
Message-ID: <66425937-a173-1bdc-dd3e-ca727797d52e@pengutronix.de> (raw)
In-Reply-To: <20220117221917.26970-8-jmaselbas@kalray.eu>

Hi,

On 17.01.22 23:19, Jules Maselbas wrote:
> From: Louis Morhet <lmorhet@kalray.eu>
> 
> As the watchdog may be set by a lower stage in the boot chain, and for
> a good reason (precisely to ensure reliable update when something
> unexpected happens during the boot chain), it is a bad idea to always
> disable it during probe.
> 
> We should either have a mechanism to refresh it on a regular basis in
> barebox itself and set it to something bigger for Linux, or handle it
> transparently and let the previous stage set the global watchdog up to
> Linux. This patch assumes for now the latter.

The latter is preferable, because barebox execution time should be bound
and the watchdog ensures that in face of spurious bugs.

There's an autopoll mechanism that tries to ensure forward progress by
polling the watchdog in is_timeout. The idea is that loops checking for
is_timeout will either see forward progress or propagate an error. This
is more robust than explicitly littering around WATCHDOG_PING()s, but it's
not immune to all bugs, so turning on the watchdog very early is IMO
the best course of action. For development use, you can always do wd 0
or wd -x which I just sent out and CC'd you on. wd -x will disable
all watchdogs either by wd 0 if supported by the hardware and driver
or by enabling autopolling.

It's a strict development feature (like wd in general. There's
global.boot.watchdog_timeout for normal use during booting).

> Signed-off-by: Louis Morhet <lmorhet@kalray.eu>
> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>

For this patch,

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Cheers,
Ahmad

> ---
>  drivers/watchdog/kvx_wdt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/kvx_wdt.c b/drivers/watchdog/kvx_wdt.c
> index da19136fda..df9430769b 100644
> --- a/drivers/watchdog/kvx_wdt.c
> +++ b/drivers/watchdog/kvx_wdt.c
> @@ -73,11 +73,9 @@ static int kvx_wdt_drv_probe(struct device_d *dev)
>  	wdd->hwdev = dev;
>  	wdd->set_timeout = kvx_wdt_set_timeout;
>  
> -	/* Be sure that interrupt are disable */
> +	/* Be sure that interrupt are disabled */
>  	kvx_sfr_set_field(TCR, WIE, 0);
>  
> -	kvx_watchdog_disable();
> -
>  	return watchdog_register(wdd);
>  }
>  
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-01-19 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 22:19 [PATCH v2 00/11] kvx arch update Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 01/11] kvx: dma: Remove arch dma_map/unmap_single Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 02/11] kvx: Move LINUX_BOOT_PARAM_MAGIC in asm/common.h Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 03/11] kvx: Accept LINUX_BOOT_PARAM_MAGIC as a valid magic value Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 04/11] common: elf: add elf_load_binary Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 05/11] kvx: enable FITIMAGE support Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 06/11] clocksource: kvx: Register as postcore_platform_driver Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 07/11] watchdog: kvx: do not disable watchdog on probe Jules Maselbas
2022-01-19 14:25   ` Ahmad Fatoum [this message]
2022-01-17 22:19 ` [PATCH v2 08/11] nvmem: add kvx otp non volatile regbank support Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 09/11] kvx: add kvx_sfr_field_val Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 10/11] drivers: add soc hierarchy properly Jules Maselbas
2022-01-17 22:19 ` [PATCH v2 11/11] soc: add kvx_socinfo driver Jules Maselbas
2022-01-18  8:09 ` [PATCH v2 00/11] kvx arch update Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66425937-a173-1bdc-dd3e-ca727797d52e@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=clement.leger@bootlin.com \
    --cc=jmaselbas@kalray.eu \
    --cc=lmichel@kalray.eu \
    --cc=lmorhet@kalray.eu \
    --cc=ysionneau@kalray.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox