All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Stefan Roese <sr@denx.de>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()
Date: Mon, 28 Jun 2021 09:44:46 +0200	[thread overview]
Message-ID: <a0a07db8-6663-851d-aab2-4826934bf944@prevas.dk> (raw)
In-Reply-To: <CAPnjgZ0XRfVnA3+t0a0efCqOoNYkSB+KJF131g_fBW9F3LtPpg@mail.gmail.com>

On 26/06/2021 20.32, Simon Glass wrote:
> Hi Rasmus,
> 
> On Tue, 22 Jun 2021 at 14:28, Rasmus Villemoes
> <rasmus.villemoes@prevas.dk> wrote:
>>

>>> I don't think it is good to start it in the post-probe. Can you do it
>>> separately, afterwards?
>>
>> Eh, yes, of course I could do this in the loop in initr_watchdog() where
>> I probe all watchdog devices, but the end result is exactly the same,
>> and it seemed that this was a perfect fit for DM since it provided this
>> post_probe hook. It's a no-op if CONFIG_WATCHDOG_AUTOSTART isn't set,
>> and if it is, that precisely means the developer wanted to start
>> handling the device(s) ASAP.
>>
>>> Probing is supposed to just probe it and it
>>> should be safe to do that without side effects.
>>
>> I agree in general, but watchdog devices are a bit special compared to
>> some random USB controller or LCD display or spi master - those devices
>> generally don't do anything unless asked to by the CPU, while a watchdog
>> device is the other way around, it does its thing _unless_ the CPU asks
>> it not to (often enough). Which in turn, I suppose, is the whole reason
>> wdt-uclass has its own hook into the initr sequence - one needs to probe
>> and possibly start handling the watchdog(s) ASAP.
> 
> It still needs a 'start' method to make it start. Having it start on
> probe means the board will reset at the command line if the device is
> probed. Yuck.

No, because while sitting in the command line waiting for user input,
WATCHDOG_RESET() is called something like a million times per second (or
at least extremely often). For the most common case of there only being
one (or zero) DM watchdogs, I'm not changing anything at all about how
things behave. I'm just expanding the handling done in the wdt-uclass
provided functions initr_watchdog() and watchdog_reset() to all DM
watchdogs, making things more consistent. And there's
CONFIG_WATCHDOG_AUTOSTART=n which as before would make the post_probe
function into a no-op.

As I said, yes, I can move the call of the post_probe function into the
loop in initr_watchdog (and then it wouldn't be called post_probe, but
probably named something including auto_start). In practice, that won't
change anything.

Stefan, what do you think? I think this is the only contentious point at
this time, so I'll do whatever you think is right, then resend the
patches with Simon's other feedback incorporated.

Rasmus

  reply	other threads:[~2021-06-28  7:44 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 22:00 [PATCH v2 00/10] handling all DM watchdogs in watchdog_reset() Rasmus Villemoes
2021-05-27 22:00 ` [PATCH v2 01/10] watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now() Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  5:54   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 02/10] watchdog: wdt-uclass.c: introduce struct wdt_priv Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  5:56   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 03/10] watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  5:57   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 04/10] watchdog: wdt-uclass.c: refactor initr_watchdog() Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  5:59   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 05/10] watchdog: wdt-uclass.c: keep track of each device's running state Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  6:04   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 06/10] sandbox: disable CONFIG_WATCHDOG_AUTOSTART Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  6:05   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset() Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-22 20:28     ` Rasmus Villemoes
2021-06-23  5:53       ` Stefan Roese
2021-06-26 18:32       ` Simon Glass
2021-06-28  7:44         ` Rasmus Villemoes [this message]
2021-06-29  6:11           ` Stefan Roese
2021-07-05 15:29           ` Simon Glass
2021-05-27 22:00 ` [PATCH v2 08/10] watchdog: add gpio watchdog driver Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  6:07   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 09/10] sandbox: add test of wdt_gpio driver Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-29  6:08   ` Stefan Roese
2021-05-27 22:00 ` [PATCH v2 10/10] sandbox: add test of wdt-uclass' watchdog_reset() Rasmus Villemoes
2021-06-22 13:31   ` Simon Glass
2021-06-22 20:29     ` Rasmus Villemoes
2021-06-26 18:32       ` Simon Glass
2021-06-29  6:08   ` Stefan Roese
2021-06-08 22:41 ` [PATCH v2 00/10] handling all DM watchdogs in watchdog_reset() Rasmus Villemoes
2021-06-10  5:28   ` Stefan Roese

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=a0a07db8-6663-851d-aab2-4826934bf944@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 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.