summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch
blob: 523a3e1a9d5bb4d14a579a85051882af2a7045a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From c82162866be3c236ed73c6a19b9a0bb3097718ae Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Sat, 12 Oct 2019 12:23:24 +0800
Subject: [PATCH] Enable watchdog to save useflag after host power off

Get the right useflag after host power off.

Tested:
Set a watchdog (Timer action is none and Time Use is BIOS FRB2)
ipmitool raw 0x06 0x24 0x01 0x00 0x00 0x00 0x40 0x00
Get watchdog
ipmitool mc watchdog get
Start watchdog
ipmitool mc watchdog reset
Get watchdog
ipmitool mc watchdog get
After timer is stop, set a watchdog again
(Timer action is none and Time Use is  BIOS/POST)
ipmitool raw 0x06 0x24 0x02 0x00 0x00 0x00 0x40 0x00
Start watchdog and wait until timer is stop,
Get watchdog
ipmitool mc watchdog get
Timer Expiration Flags should be 0x06(BIOS FRB2, BIOS/POST)
Power down the Host
Ipmitool chassis power off
Check the Timer Expiration Flags(User Flags)
ipmitool mc watchdog get
Timer Expiration Flags should be 0x06(BIOS FRB2, BIOS/POST)

Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
---
 app/watchdog.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/watchdog.cpp b/app/watchdog.cpp
index c64a92f..2ff9ee9 100644
--- a/app/watchdog.cpp
+++ b/app/watchdog.cpp
@@ -437,22 +437,20 @@ ipmi::RspType<uint3_t, // timerUse - timer use
                     wdTimerUseToIpmiTimerUse(wd_prop.expiredTimerUse));
         }
 
+        expireFlags = timerUseExpirationFlags;
         if (wd_prop.enabled)
         {
             presentCountdown = htole16(wd_prop.timeRemaining / 100);
-            expireFlags = 0;
         }
         else
         {
             if (wd_prop.expiredTimerUse == WatchdogService::TimerUse::Reserved)
             {
                 presentCountdown = initialCountdown;
-                expireFlags = 0;
             }
             else
             {
                 presentCountdown = 0;
-                expireFlags = timerUseExpirationFlags;
                 // Automatically clear it whenever a timer expiration occurs.
                 timerNotLogFlags = false;
             }
-- 
2.7.4