All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de, Andre Przywara <andre.przywara@arm.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices()
Date: Tue, 31 Jan 2023 15:48:48 +0100	[thread overview]
Message-ID: <0dc24836-959c-25d1-cfc7-b023f8f5f860@canonical.com> (raw)
In-Reply-To: <CAPnjgZ3DtVEn9UgR5ZraiX48vom4XN+X2vZa4QQGJ7pLeQPaeA@mail.gmail.com>

On 1/31/23 15:16, Simon Glass wrote:
> Hi,
> 
> On Tue, 31 Jan 2023 at 05:04, Ilias Apalodimas
> <ilias.apalodimas@linaro.org> wrote:
>>
>> Hi all,
>>
>> On Mon, Jan 30, 2023 at 01:30:49PM -0500, Tom Rini wrote:
>>> On Mon, Jan 30, 2023 at 01:13:55PM -0500, Tom Rini wrote:
>>>> On Sat, Jan 28, 2023 at 09:57:45AM +0100, Heinrich Schuchardt wrote:
<snip />
>>>>
>>>> I thought we had rejected going down this path since the UEFI spec is
>>>> unhelpfully wrong if it insists this?
>>>
>>> Because, to be clear, stopping hardware watchdogs is not to be done. The
>>> one in-tree caller of wdt_stop_all is very questionable. You cannot
>>> seriously stop a watchdog until someone else can hopefully resume it as
>>> that violates the function of a hardware watchdog. A pure software
>>> watchdog is one thing, and a hardware watchdog is another. I feel like
>>> the most likely answer here is that someone needs to, still, push back
>>> to the UEFI specification to get hardware watchdogs better understood
>>> and handled, as it must never be stopped once started and if you cannot
>>> reach the next stage in time, that's an engineering issue to resolve. My
>>> first guess is that ExitBootServices should service the watchdog one
>>> last time to ensure the largest window of time for the OS to take over
>>> servicing of the watchdog.
>>>
>>
>> There's two scenarios I can think of
>> 1. After U-Boot is done it can disable the hardware watchdog.
>>     The kernel will go through the EFI-stub -> kernel proper -> watchdog
>>     gets re-initialized.  In that case you are *hoping* that device won't
>>     hang in the efi-stub or until the wd is up again.
>> 2. EFI makes sure the hardware wd gets configured with the highest allowed
>>     value.  The efi-stub doesn't have any driver to refresh the wd, so we
>>     will again rely on the wd driver coming up and refreshing the timers.
>>
>>
>> None of those is perfect, but I prefer the latter
> 
> How does this work if U-Boot runs grub instead of Linux? Does grub
> update the watchdog?
> 

U-Boot will reset the watchdog when the UEFI API is invoked to read the 
console or to access the network or block devices. Just grep for 
"efi_timer_check()".

Best regards

Heinrich


  reply	other threads:[~2023-01-31 14:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-28  8:57 [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices() Heinrich Schuchardt
2023-01-30 18:13 ` Tom Rini
2023-01-30 18:30   ` Tom Rini
2023-01-31 12:03     ` Ilias Apalodimas
2023-01-31 14:16       ` Simon Glass
2023-01-31 14:48         ` Heinrich Schuchardt [this message]
2023-01-31 15:07       ` Tom Rini
2023-02-01  8:32         ` Rasmus Villemoes
2023-02-01  9:00           ` Heinrich Schuchardt
2023-02-02  8:17             ` Etienne Carriere
2023-02-02 17:12               ` Simon Glass
2023-02-02 17:22                 ` Tom Rini
2023-02-03  2:15                   ` Simon Glass
2023-02-03  7:30                     ` Rasmus Villemoes
2023-02-07 14:59                       ` Michael Walle
2023-02-07 15:08                         ` Heinrich Schuchardt
2023-02-07 15:29                           ` Michael Walle
2023-02-07 15:30                             ` Heinrich Schuchardt
2023-02-07 15:34                               ` Michael Walle
2023-02-03 15:51                     ` Tom Rini
2023-02-04  0:20                       ` Simon Glass
2023-02-01 12:49           ` Mark Kettenis
2023-02-01 15:21             ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2021-11-09 10:19 Heinrich Schuchardt
2021-11-09 10:19 ` Heinrich Schuchardt
2021-11-09 14:20   ` Michael Walle
2021-11-09 14:46     ` Mark Kettenis
2021-11-09 14:54       ` Michael Walle
2021-11-09 17:30         ` Heinrich Schuchardt
2021-11-09 17:55   ` Tom Rini
2021-11-09 18:15     ` Heinrich Schuchardt
2021-11-09 18:18       ` Tom Rini
2021-11-09 21:47         ` Andre Przywara
2021-11-09 23:45     ` Grant Likely

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=0dc24836-959c-25d1-cfc7-b023f8f5f860@canonical.com \
    --to=heinrich.schuchardt@canonical.com \
    --cc=andre.przywara@arm.com \
    --cc=ilias.apalodimas@linaro.org \
    --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.