All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Simon Glass <sjg@chromium.org>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v3 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()
Date: Sat, 31 Jul 2021 12:06:11 +0200	[thread overview]
Message-ID: <23dee29a-33a9-7f46-1ab1-1f077b28c011@denx.de> (raw)
In-Reply-To: <d5a40966-bd79-654b-43d9-d30acc4d3e8e@denx.de>

Hi Rasmus,

On 15.07.21 10:15, Stefan Roese wrote:
> Hi Rasmus,
> 
> On 05.07.21 17:30, Simon Glass wrote:
>> Hi Rasmus,
>>
>> On Fri, 2 Jul 2021 at 06:45, Rasmus Villemoes
>> <rasmus.villemoes@prevas.dk> wrote:
>>>
>>> A board can have and make use of more than one watchdog device, say
>>> one built into the SOC and an external gpio-petted one. Having
>>> wdt-uclass only handle the first is both a little arbitrary and
>>> unexpected.
>>>
>>> So change initr_watchdog() so we visit (probe) all DM watchdog
>>> devices. This essentially boils down to making the init_watchdog_dev
>>> function into a .post_probe method.
>>>
>>> Similarly let watchdog_reset() loop over the whole uclass - each
>>> having their own ratelimiting metadata, and a separate "is this device
>>> running" flag.
>>>
>>> This gets rid of the watchdog_dev member of struct global_data.  We
>>> do, however, still need the GD_FLG_WDT_READY set in
>>> initr_watchdog(). This is because watchdog_reset() can get called
>>> before DM is ready, and I don't think we can call uclass_get() that
>>> early.
>>>
>>> The current code just returns 0 if "getting" the first device fails -
>>> that can of course happen because there are no devices, but it could
>>> also happen if its ->probe call failed. In keeping with that, continue
>>> with the handling of the remaining devices even if one fails to
>>> probe. This is also why we cannot use uclass_probe_all().
>>>
>>> If desired, it's possible to later add a per-device "u-boot,autostart"
>>> boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART
>>> per-device.
>>>
>>> Reviewed-by: Stefan Roese <sr@denx.de>
>>> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
>>> ---
>>>   drivers/watchdog/wdt-uclass.c     | 96 ++++++++++++++++++-------------
>>>   include/asm-generic/global_data.h |  6 --
>>>   2 files changed, 56 insertions(+), 46 deletions(-)
>>>
>>
>> Please see my belated reply on the previous version of this patch.
> 
> Rasmus, do you plan to send an updated patchset version, addressing
> Simons's comments?

Any updates on this?

Thanks,
Stefan

  reply	other threads:[~2021-07-31 10:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 12:45 [PATCH v3 00/10] handling all DM watchdogs in watchdog_reset() Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 01/10] watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now() Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 02/10] watchdog: wdt-uclass.c: introduce struct wdt_priv Rasmus Villemoes
2021-07-05  7:17   ` Stefan Roese
2021-07-02 12:45 ` [PATCH v3 03/10] watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 04/10] watchdog: wdt-uclass.c: refactor initr_watchdog() Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 05/10] watchdog: wdt-uclass.c: keep track of each device's running state Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 06/10] sandbox: disable CONFIG_WATCHDOG_AUTOSTART Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset() Rasmus Villemoes
2021-07-05 15:30   ` Simon Glass
2021-07-15  8:15     ` Stefan Roese
2021-07-31 10:06       ` Stefan Roese [this message]
2021-08-02  9:18         ` Rasmus Villemoes
2021-08-02 10:39           ` Stefan Roese
2021-08-02 19:20           ` Simon Glass
2021-08-03  6:48             ` Rasmus Villemoes
2021-08-04 14:35               ` Simon Glass
2021-07-02 12:45 ` [PATCH v3 08/10] watchdog: add gpio watchdog driver Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 09/10] sandbox: add test of wdt_gpio driver Rasmus Villemoes
2021-07-02 12:45 ` [PATCH v3 10/10] sandbox: add test of wdt-uclass' watchdog_reset() Rasmus Villemoes

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=23dee29a-33a9-7f46-1ab1-1f077b28c011@denx.de \
    --to=sr@denx.de \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --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.