diff mbox series

[3/9] ipmi-watchdog: Don't reset the watchdog twice

Message ID 20180524001335.15457-4-wak@google.com
State Accepted
Headers show
Series ipmi-watchdog: Fixes for error handling and general cleanups | expand

Commit Message

William Kennington May 24, 2018, 12:13 a.m. UTC
There is no clarification for why this change was needed, but presumably
this is due to a buggy BMC implementation where the Watchdog Set command
was processed concurrently or after the initial Watchdog Reset. This
inversion would cause the watchdog to stop since the DONT_STOP bit was
not set. Since we are now using the DONT_STOP bit during initialization,
the watchdog should not be stopped even if an inversion occurs.

Signed-off-by: William A. Kennington III <wak@google.com>
---
 hw/ipmi/ipmi-watchdog.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Alistair Popple May 25, 2018, 12:28 a.m. UTC | #1
On Wednesday, 23 May 2018 5:13:29 PM AEST William A. Kennington III wrote:
> There is no clarification for why this change was needed, but presumably
> this is due to a buggy BMC implementation where the Watchdog Set command

That is correct, although I'm not sure if the buggy BMC implementation
was ever fixed so we should probably test this on a P8 box as well.

- Alistair

> was processed concurrently or after the initial Watchdog Reset. This
> inversion would cause the watchdog to stop since the DONT_STOP bit was
> not set. Since we are now using the DONT_STOP bit during initialization,
> the watchdog should not be stopped even if an inversion occurs.
> 
> Signed-off-by: William A. Kennington III <wak@google.com>
> ---
>  hw/ipmi/ipmi-watchdog.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/hw/ipmi/ipmi-watchdog.c b/hw/ipmi/ipmi-watchdog.c
> index ee1608443..e8efba2b4 100644
> --- a/hw/ipmi/ipmi-watchdog.c
> +++ b/hw/ipmi/ipmi-watchdog.c
> @@ -143,9 +143,5 @@ void ipmi_wdt_init(void)
>  	 * could crash before the wdt has actually been started. */
>  	sync_reset_wdt();
>  
> -	/* For some reason we have to reset it twice to get it to
> -	 * actually start the first time. */
> -	sync_reset_wdt();
> -
>  	return;
>  }
>
William Kennington May 25, 2018, 2:46 a.m. UTC | #2
That sounds like a good plan. Do you have access to any of those? We only
have our custom P8 boxes here which don't have a BMC.
On Thu, May 24, 2018 at 5:28 PM Alistair Popple <alistair@popple.id.au>
wrote:

> On Wednesday, 23 May 2018 5:13:29 PM AEST William A. Kennington III wrote:
> > There is no clarification for why this change was needed, but presumably
> > this is due to a buggy BMC implementation where the Watchdog Set command

> That is correct, although I'm not sure if the buggy BMC implementation
> was ever fixed so we should probably test this on a P8 box as well.

> - Alistair

> > was processed concurrently or after the initial Watchdog Reset. This
> > inversion would cause the watchdog to stop since the DONT_STOP bit was
> > not set. Since we are now using the DONT_STOP bit during initialization,
> > the watchdog should not be stopped even if an inversion occurs.
> >
> > Signed-off-by: William A. Kennington III <wak@google.com>
> > ---
> >  hw/ipmi/ipmi-watchdog.c | 4 ----
> >  1 file changed, 4 deletions(-)
> >
> > diff --git a/hw/ipmi/ipmi-watchdog.c b/hw/ipmi/ipmi-watchdog.c
> > index ee1608443..e8efba2b4 100644
> > --- a/hw/ipmi/ipmi-watchdog.c
> > +++ b/hw/ipmi/ipmi-watchdog.c
> > @@ -143,9 +143,5 @@ void ipmi_wdt_init(void)
> >        * could crash before the wdt has actually been started. */
> >       sync_reset_wdt();
> >
> > -     /* For some reason we have to reset it twice to get it to
> > -      * actually start the first time. */
> > -     sync_reset_wdt();
> > -
> >       return;
> >  }
> >
Stewart Smith May 28, 2018, 5:24 a.m. UTC | #3
William Kennington <wak@google.com> writes:
> That sounds like a good plan. Do you have access to any of those? We only
> have our custom P8 boxes here which don't have a BMC.

Yeah, we do. P8 with buggy BMCs we have.
Stewart Smith June 5, 2018, 5 a.m. UTC | #4
Stewart Smith <stewart@linux.ibm.com> writes:

> William Kennington <wak@google.com> writes:
>> That sounds like a good plan. Do you have access to any of those? We only
>> have our custom P8 boxes here which don't have a BMC.
>
> Yeah, we do. P8 with buggy BMCs we have.

Oh how I'd forgotten how much I dislike these BMCs. The bugs in serial
over LAN alone are worth the entire effort that is OpenBMC.

Anyway, things appeared to work, so it *must* be fine :)
diff mbox series

Patch

diff --git a/hw/ipmi/ipmi-watchdog.c b/hw/ipmi/ipmi-watchdog.c
index ee1608443..e8efba2b4 100644
--- a/hw/ipmi/ipmi-watchdog.c
+++ b/hw/ipmi/ipmi-watchdog.c
@@ -143,9 +143,5 @@  void ipmi_wdt_init(void)
 	 * could crash before the wdt has actually been started. */
 	sync_reset_wdt();
 
-	/* For some reason we have to reset it twice to get it to
-	 * actually start the first time. */
-	sync_reset_wdt();
-
 	return;
 }