public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@arm.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>,
	 "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH 2/4] ArmPlatformPkg/SP805WatchdogDxe: switch to interrupt mode
Date: Wed, 19 Dec 2018 14:33:09 +0530	[thread overview]
Message-ID: <CAJuA9ai+1FS=pHTQ-hx8+66wn=ngzxn2Q9mn924BOOAyY85VmA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu8=vKQBrEznrcqrcseJQjCTsN8aerJiBA5qbtt0eU=QNg@mail.gmail.com>

Hi Ard,

On Tue, Dec 18, 2018 at 9:59 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Tue, 18 Dec 2018 at 14:39, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> >
> > On Tue, Dec 18, 2018 at 02:10:12PM +0100, Ard Biesheuvel wrote:
> > > The SP805 watchdog driver doesn't implement the PI watchdog protocol
> > > fully, but always simply resets the system if the watchdog time runs
> > > out.
> > >
> > > However, the hardware does support the intended usage model, as long
> > > as the SP805 is wired up correctly. So let's implement interrupt based
> > > mode involving a handler that is registered by the DXE core and invoked
> > > when the watchdog runs out. In the interrupt handler, we invoke the
> > > notify function if one was registered, or call the ResetSystem()
> > > runtime service otherwise (as per the UEFI spec)
> >
> > The only question mark from my end is - what happens when the
> > interrupt isn't wired up correctly? Would it be worth to bail out and
> > refuse to register the driver if PcdSP805WatchdogInterrupt is set to
> > 0?
> >
> > Thomas?
> >
>
> I have left the code in place that enables the hard reset, but the
> timeout is double the programmed value (since the countdown timer is
> restarted on an interrupt, and the hard reset is generated when it
> reaches zero the second time)
>
> This should cover both the miswired interrupt scenario, and the
> scenario where ResetSystem() (or the handler) gets stuck and never
> returns.

Yes, this would suffice. But the system would reset after twice the
amount of time than programmed, which probably is okay.

-Thomas.

> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2018-12-19  9:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 13:10 [PATCH 0/4] ArmPkg, ArmPlatformPkg: watchdog driver cleanup Ard Biesheuvel
2018-12-18 13:10 ` [PATCH 1/4] ArmPlatformPkg/SP805WatchdogDxe: cosmetic cleanup Ard Biesheuvel
2018-12-18 13:35   ` Leif Lindholm
2018-12-18 13:10 ` [PATCH 2/4] ArmPlatformPkg/SP805WatchdogDxe: switch to interrupt mode Ard Biesheuvel
2018-12-18 13:39   ` Leif Lindholm
2018-12-18 16:29     ` Ard Biesheuvel
2018-12-19  9:03       ` Thomas Abraham [this message]
2018-12-18 15:58   ` Udit Kumar
2018-12-18 16:23     ` Ard Biesheuvel
2018-12-18 13:10 ` [PATCH 3/4] ArmPkg/GenericWatchdogDxe: clean up the code Ard Biesheuvel
2018-12-18 13:43   ` Leif Lindholm
2018-12-18 15:19     ` Ard Biesheuvel
2018-12-18 15:24       ` Leif Lindholm
2018-12-18 13:10 ` [PATCH 4/4] ArmPkg/GenericWatchdogDxe: implement RegisterHandler() method Ard Biesheuvel
2018-12-18 13:44   ` Leif Lindholm
2018-12-18 16:00   ` Udit Kumar

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-list 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='CAJuA9ai+1FS=pHTQ-hx8+66wn=ngzxn2Q9mn924BOOAyY85VmA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /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