Skip to content

Commit 9caf128

Browse files
DellEMC: S52xx Reboot cause fix (#10783)
1 parent abb977f commit 9caf128

File tree

2 files changed

+8
-7
lines changed
  • platform/broadcom/sonic-platform-modules-dell

2 files changed

+8
-7
lines changed

platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/chassis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Chassis(ChassisBase):
3838

3939
oir_fd = -1
4040
epoll = -1
41-
41+
REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason"
4242
_global_port_pres_dict = {}
4343

4444
def __init__(self):
@@ -239,15 +239,15 @@ def get_reboot_cause(self):
239239
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
240240

241241
if reboot_cause & 0x1:
242-
return (self.REBOOT_CAUSE_POWER_LOSS, None)
242+
return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset")
243243
elif reboot_cause & 0x2:
244244
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
245245
elif reboot_cause & 0x4:
246246
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown")
247247
elif reboot_cause & 0x8:
248-
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None)
248+
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload")
249249
elif reboot_cause & 0x10:
250-
return (self.REBOOT_CAUSE_WATCHDOG, None)
250+
return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset")
251251
elif reboot_cause & 0x20:
252252
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown")
253253
elif reboot_cause & 0x40:

platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ def get_num_sfps(self):
309309
An integer represences the number of SFPs on the chassis.
310310
"""
311311
return self._num_sfps
312+
312313
def get_reboot_cause(self):
313314
"""
314315
Retrieves the cause of the previous reboot
@@ -326,15 +327,15 @@ def get_reboot_cause(self):
326327
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
327328

328329
if reboot_cause & 0x1:
329-
return (self.REBOOT_CAUSE_POWER_LOSS, None)
330+
return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset")
330331
elif reboot_cause & 0x2:
331332
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
332333
elif reboot_cause & 0x4:
333334
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown")
334335
elif reboot_cause & 0x8:
335-
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None)
336+
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload")
336337
elif reboot_cause & 0x10:
337-
return (self.REBOOT_CAUSE_WATCHDOG, None)
338+
return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset")
338339
elif reboot_cause & 0x20:
339340
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown")
340341
elif reboot_cause & 0x40:

0 commit comments

Comments
 (0)