All of lore.kernel.org
 help / color / mirror / Atom feed
* BMC can’t get watchdog status by command “mc watchdog get” when system power is off
@ 2019-11-05  1:39 Wayne Tung/WYHQ/Wiwynn
  2019-11-05  9:18 ` vishwa
  0 siblings, 1 reply; 3+ messages in thread
From: Wayne Tung/WYHQ/Wiwynn @ 2019-11-05  1:39 UTC (permalink / raw)
  To: openbmc


[-- Attachment #1.1: Type: text/plain, Size: 3151 bytes --]

Hi,

We met an error that BMC can’t get watchdog status by command “mc watchdog get” when system power is off.

Cause:
"ipmitool mc watchdog get" gets dbus properties in path: /xyz/openbmc_project/watchdog/host0 interface: xyz.openbmc_project.State.Watchdog and this dbus object is registered by phosphor-watchdog.service.
Because phosphor-watchdog.service will not be started before system power-on and will be stopped after system power-off, therefore "ipmitool mc watchdog get" command gets nothing when system power is off.

Follow the standard, BMC should still report watchdog status even if system power is off.

So we modified phosphor-watchdog’s bb file and service file to
1. Start phosphor-watchdog after multi-user.target during BMC boot period
2. Do not stop phosphor-watchdog when system power off.
3. Always restart phosphor-watchdog.service.

Test Result:
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power status
Chassis Power is off
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0x81)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      0 sec
Present Countdown:      0 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power on
Chassis Power Control: Up/On
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0xc1)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      600 sec
Present Countdown:      597 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0xc1)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      600 sec
Present Countdown:      582 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0x81)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      0 sec
Present Countdown:      0 sec

Thanks


---------------------------------------------------------------------------------------------------------------------------------------------------------------
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. 
Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited.
If you are not the intended recipient, you may reply to the sender and should delete this e-mail immediately.
---------------------------------------------------------------------------------------------------------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 13823 bytes --]

[-- Attachment #2: 0001-Fix-ipmitool-mc-watchdog-get.patch --]
[-- Type: application/octet-stream, Size: 4967 bytes --]

From f2cdfcc2b7e70c4062abd755796070b2858cca5c Mon Sep 17 00:00:00 2001
From: Wayne Tung <Wayne_Tung@wiwynn.com>
Date: Fri, 25 Oct 2019 11:19:48 +0800
Subject: [PATCH] Fix ipmitool mc watchdog get

Descrption:
- Fix "ipmitool <oob> bmc watchdog get" failed when system is power-off.

Cause:
- "ipmitool mc watchdog get" gets dbus properties in path: /xyz/openbmc_project/watchdog/host0 interface: xyz.openbmc_project.State.Watchdog and this dbus object is registered by phosphor-watchdog.service.
- Because phosphor-watchdog.service will not be started before system power-on and will be stopped after system power-off, "ipmitool mc watchdog get" will fail when system power-off.

Fix:
- Start phosphor-watchdog when bmc boot and after multi-user.target.
- Modify service conflicts and do not stop phosphor-watchdog when system power off.
- Always restart phosphor-watchdog after it is killed.

Test Result:
[Test Step]
1. test ipmitool mc watchdog get after bmc boot. (pass)
2. test ipmitool mc watchdog get after ipmitool chassis power off. (pass)
3. test ipmitool mc watchdog get after receiving SIGKILL. (pass)

[Remote]
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     Reserved (0x80)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      30 sec
Present Countdown:      30 sec
wayne@TGA:~$
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power off
Chassis Power Control: Down/Off
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power status
Chassis Power is off
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     Reserved (0x80)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      30 sec
Present Countdown:      30 sec

[Server]
c2030:~# ps | grep phosphor-watchdog
  233 root      6916 S    phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog --path=/xyz/openbmc_project
  507 root      2968 S    grep phosphor-watchdog
c2030:~# kill -9 233

[Remote]
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     Reserved (0x80)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      30 sec
Present Countdown:      30 sec
---
 .../watchdog/phosphor-watchdog/phosphor-watchdog@.service              | 2 +-
 meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf | 3 ---
 meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog_git.bb       | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service
index 52c1290..11d1cd1 100644
--- a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service
+++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service
@@ -2,7 +2,7 @@
 Description=Phosphor %I watchdog
 
 [Service]
-Restart=no
+Restart=always
 EnvironmentFile={envfiledir}/obmc/watchdog/%I
 ExecStart=/usr/bin/env phosphor-watchdog --continue --service=${{SERVICE}} --path=${{DEVPATH}} --target=${{TARGET}}
 SyslogIdentifier=phosphor-watchdog
diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf
index b253249..3a8466d 100644
--- a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf
+++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf
@@ -1,4 +1 @@
 [Unit]
-Conflicts=obmc-host-stop@0.target
-Conflicts=obmc-chassis-poweroff@0.target
-Conflicts=obmc-host-quiesce@0.target
diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog_git.bb b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog_git.bb
index 79fa620..357baf1 100644
--- a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog_git.bb
+++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog_git.bb
@@ -48,7 +48,7 @@ SYSTEMD_SERVICE_${PN} += "${ENABLE_WATCHDOG_TMPL}"
 WATCHDOG_TGTFMT = "phosphor-watchdog@{0}.service"
 ENABLE_WATCHDOG_TGTFMT = "obmc-enable-host-watchdog@{0}.service"
 
-WATCHDOG_FMT = "../${WATCHDOG_TMPL}:obmc-host-startmin@{1}.target.wants/${WATCHDOG_TGTFMT}"
+WATCHDOG_FMT = "../${WATCHDOG_TMPL}:multi-user.target.wants/${WATCHDOG_TGTFMT}"
 ENABLE_WATCHDOG_FMT = "../${ENABLE_WATCHDOG_TMPL}:obmc-host-startmin@{0}.target.wants/${ENABLE_WATCHDOG_TGTFMT}"
 
 SYSTEMD_LINK_${PN} += "${@compose_list(d, 'WATCHDOG_FMT', 'OBMC_HOST_WATCHDOG_INSTANCES', 'OBMC_HOST_INSTANCES')}"
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: BMC can’t get watchdog status by command “mc watchdog get” when system power is off
  2019-11-05  1:39 BMC can’t get watchdog status by command “mc watchdog get” when system power is off Wayne Tung/WYHQ/Wiwynn
@ 2019-11-05  9:18 ` vishwa
  2019-11-20  8:35   ` Wayne Tung/WYHQ/Wiwynn
  0 siblings, 1 reply; 3+ messages in thread
From: vishwa @ 2019-11-05  9:18 UTC (permalink / raw)
  To: Wayne Tung/WYHQ/Wiwynn, openbmc

[-- Attachment #1: Type: text/plain, Size: 3936 bytes --]

Wayne,

Thanks for writing. Here is my thought on this.

- phosphor-watchdog was meant to time the Host booting, and hence it is 
getting started where ever it is.
- There are other external users for watchdog ( like bmcweb ). So we 
need to see if this change affects those.
- Could you help show which section demands this service to be mandatory 
available per IPMI v2.0 ?
- What do you expect IPMI to tell when the host is off ?
- Lastly, please help push a gerrit review, so we could add comments there.

Thanks..

!! Vishwa !!

On 11/5/19 7:09 AM, Wayne Tung/WYHQ/Wiwynn wrote:
>
> Hi,
>
> We met an error that BMC can’t get watchdog status by command “mc 
> watchdog get” when system power is off.
>
> Cause:
>
> "ipmitool mc watchdog get" gets dbus properties in path: 
> /xyz/openbmc_project/watchdog/host0 interface: 
> xyz.openbmc_project.State.Watchdog and this dbus object is registered 
> by phosphor-watchdog.service.
>
> Because phosphor-watchdog.service will not be started before system 
> power-on and will be stopped after system power-off, therefore 
> "ipmitool mc watchdog get" command gets nothing when system power is off.
>
> Follow the standard, BMC should still report watchdog status even if 
> system power is off.
>
> So we modified phosphor-watchdog’s bb file and service file to
> 1. Start phosphor-watchdog after multi-user.target during BMC boot period
>
> 2. Do not stop phosphor-watchdog when system power off.
>
> 3. Always restart phosphor-watchdog.service.
>
> Test Result:
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> chassis power status
>
> Chassis Power is off
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> bmc watchdog get
>
> Watchdog Timer Use:     BIOS FRB2 (0x81)
>
> Watchdog Timer Is:      Stopped
>
> Watchdog Timer Actions: No action (0x00)
>
> Pre-timeout interval:   0 seconds
>
> Timer Expiration Flags: 0x00
>
> Initial Countdown:      0 sec
>
> Present Countdown:      0 sec
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> chassis power on
>
> Chassis Power Control: Up/On
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> bmc watchdog get
>
> Watchdog Timer Use:     BIOS FRB2 (0xc1)
>
> Watchdog Timer Is:      Started/Running
>
> Watchdog Timer Actions: Hard Reset (0x01)
>
> Pre-timeout interval:   0 seconds
>
> Timer Expiration Flags: 0x00
>
> Initial Countdown:      600 sec
>
> Present Countdown:      597 sec
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> bmc watchdog get
>
> Watchdog Timer Use:     BIOS FRB2 (0xc1)
>
> Watchdog Timer Is:      Started/Running
>
> Watchdog Timer Actions: Hard Reset (0x01)
>
> Pre-timeout interval:   0 seconds
>
> Timer Expiration Flags: 0x00
>
> Initial Countdown:      600 sec
>
> Present Countdown:      582 sec
>
> wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus 
> bmc watchdog get
>
> Watchdog Timer Use:     BIOS FRB2 (0x81)
>
> Watchdog Timer Is:      Stopped
>
> Watchdog Timer Actions: No action (0x00)
>
> Pre-timeout interval:   0 seconds
>
> Timer Expiration Flags: 0x00
>
> Initial Countdown:      0 sec
>
> Present Countdown:      0 sec
>
> Thanks
>
> *---------------------------------------------------------------------------------------------------------------------------------------------------------------*
>
> *This email contains confidential or legally privileged information 
> and is for the sole use of its intended recipient. *
>
> *Any unauthorized review, use, copying or distribution of this email 
> or the content of this email is strictly prohibited.*
>
> *If you are not the intended recipient, you may reply to the sender 
> and should delete this e-mail immediately.*
>
> *---------------------------------------------------------------------------------------------------------------------------------------------------------------*
>

[-- Attachment #2: Type: text/html, Size: 16534 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: BMC can’t get watchdog status by command “mc watchdog get” when system power is off
  2019-11-05  9:18 ` vishwa
@ 2019-11-20  8:35   ` Wayne Tung/WYHQ/Wiwynn
  0 siblings, 0 replies; 3+ messages in thread
From: Wayne Tung/WYHQ/Wiwynn @ 2019-11-20  8:35 UTC (permalink / raw)
  To: vishwa, openbmc
  Cc: Bonnie Lo/WYHQ/Wiwynn, Delphine Chiu/WYHQ/Wiwynn, Neeraj Ladkani'

[-- Attachment #1: Type: text/plain, Size: 5024 bytes --]

Vishwa,

Thanks for replying!

Here is our thought and response.

- Could you help show which section demands this service to be mandatory available per IPMI v2.0 ?
-> This command is in section 27.7 Get Watchdog Timer Command in IPMI v2.0.

- What do you expect IPMI to tell when the host is off ?
We expect that IPMI can tell user the last status of watchdog because we want to let users know which stage of booting failed when host power on failed.

The information we want to know is as follow:

  1.  Watchdog Timer Use: Which stage of booting use the watchdog timer.
  2.  Watchdog Timer Actions: Watchdog timeout action.
  3.  Initial Countdown: Initial time of watchdog timer.

Here is an example of IPMI mc watchdog get response
Watchdog Timer Use:     Reserved (0x80)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      30 sec
Present Countdown:      30 sec



From: vishwa <vishwa@linux.vnet.ibm.com>
Sent: Tuesday, November 5, 2019 5:18 PM
To: Wayne Tung/WYHQ/Wiwynn <Wayne_Tung@wiwynn.com>; openbmc@lists.ozlabs.org
Subject: Re: BMC can’t get watchdog status by command “mc watchdog get” when system power is off


Wayne,

Thanks for writing. Here is my thought on this.

- phosphor-watchdog was meant to time the Host booting, and hence it is getting started where ever it is.
- There are other external users for watchdog ( like bmcweb ). So we need to see if this change affects those.
- Could you help show which section demands this service to be mandatory available per IPMI v2.0 ?
- What do you expect IPMI to tell when the host is off ?
- Lastly, please help push a gerrit review, so we could add comments there.

Thanks..

!! Vishwa !!
On 11/5/19 7:09 AM, Wayne Tung/WYHQ/Wiwynn wrote:
Hi,

We met an error that BMC can’t get watchdog status by command “mc watchdog get” when system power is off.

Cause:
"ipmitool mc watchdog get" gets dbus properties in path: /xyz/openbmc_project/watchdog/host0 interface: xyz.openbmc_project.State.Watchdog and this dbus object is registered by phosphor-watchdog.service.
Because phosphor-watchdog.service will not be started before system power-on and will be stopped after system power-off, therefore "ipmitool mc watchdog get" command gets nothing when system power is off.

Follow the standard, BMC should still report watchdog status even if system power is off.

So we modified phosphor-watchdog’s bb file and service file to
1. Start phosphor-watchdog after multi-user.target during BMC boot period
2. Do not stop phosphor-watchdog when system power off.
3. Always restart phosphor-watchdog.service.

Test Result:
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power status
Chassis Power is off
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0x81)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      0 sec
Present Countdown:      0 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus chassis power on
Chassis Power Control: Up/On
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0xc1)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      600 sec
Present Countdown:      597 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0xc1)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      600 sec
Present Countdown:      582 sec
wayne@TGA:~$ ipmitool -H 10.248.42.74 -U root -P 0penBmc -I lanplus bmc watchdog get
Watchdog Timer Use:     BIOS FRB2 (0x81)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      0 sec
Present Countdown:      0 sec

Thanks


---------------------------------------------------------------------------------------------------------------------------------------------------------------

This email contains confidential or legally privileged information and is for the sole use of its intended recipient.

Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited.

If you are not the intended recipient, you may reply to the sender and should delete this e-mail immediately.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

[-- Attachment #2: Type: text/html, Size: 20143 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-20  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  1:39 BMC can’t get watchdog status by command “mc watchdog get” when system power is off Wayne Tung/WYHQ/Wiwynn
2019-11-05  9:18 ` vishwa
2019-11-20  8:35   ` Wayne Tung/WYHQ/Wiwynn

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.