Skip to content

Commit 7271f9d

Browse files
Sudharsan D.Gyxieca
authored andcommitted
[devices]: Poller to detect Intel Rangely LPC failure for dell z9100/s6100 (#3065)
- What I did Added Daemon to Log LPC bus degradation in Intel C2000 processor. Intel Rangeley C2000 processors with revision less than or equal to 2 have issue where LPC bus degrades over time in some processors. To identify the problem and to notify the issue, a daemon has been added which will log on encountering the issue. - How I did it Added a daemon which validates the CPLD scratch(0x102) and SMF scratch(0x202) registers by writing and reading values on regular polling intervals (300 seconds). If there is a discrepancy between read and write, a critical log will be thrown. - How to verify it The infra is verify by simulating the issue where between write and read, the value in register is modified and the log appearance is checked. - Description for the changelog Added Daemon to identify LPC bus degradation issue and notify using syslog in Dell S6100 and Z9100 platforms. This daemon will only run on processors with revision less than or equal to 2.
1 parent 1f21077 commit 7271f9d

7 files changed

Lines changed: 81 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
REV=$(lspci -xxx -s 0:0.0 | grep rev | awk -F 'rev ' '{print $2}' | sed 's/)//')
3+
if [ $REV -gt 2 ]
4+
then
5+
exit 0
6+
fi
7+
8+
test_val=(55 aa)
9+
num_val=${#test_val[@]}
10+
index=0
11+
poll_interval=300
12+
cpld_scratch_reg=0x102
13+
smf_scratch_reg=0x202
14+
15+
function log_crit() {
16+
local msg=$1
17+
18+
`logger -p user.crit -t DELL_LPC_BUS_MON $msg`
19+
}
20+
21+
function validate_lpc() {
22+
local reg=$1
23+
local val=$2
24+
local reg_str="CPLD scratch register"
25+
26+
if [ $reg == $smf_scratch_reg ]
27+
then
28+
reg_str="SMF scratch register"
29+
fi
30+
io_rd_wr.py --set --val $val --offset $reg
31+
get_val=$(io_rd_wr.py --get --offset $reg | cut -d " " -f3)
32+
if [ $val != $get_val ]
33+
then
34+
log_crit "LPC bus has deteriorated on this unit. \
35+
$reg_str has value $get_val while expected is $val \
36+
Please contact technical support"
37+
fi
38+
}
39+
while true
40+
do
41+
val=${test_val[$index]}
42+
validate_lpc $cpld_scratch_reg $val
43+
validate_lpc $smf_scratch_reg $val
44+
index=$(((index+1)%num_val))
45+
sleep $poll_interval
46+
done

platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ common/dell_i2c_utils.sh usr/local/bin
44
common/io_rd_wr.py usr/local/bin
55
common/fstrim.timer etc/systemd/system
66
common/fstrim.service etc/systemd/system
7+
common/dell_lpc_mon.sh usr/local/bin
78
s6100/scripts/platform_sensors.py usr/local/bin
89
s6100/scripts/platform_watchdog_enable.sh usr/local/bin
910
s6100/scripts/platform_watchdog_disable.sh usr/local/bin
1011
s6100/scripts/sensors usr/bin
1112
s6100/systemd/platform-modules-s6100.service etc/systemd/system
1213
s6100/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
14+
s6100/systemd/s6100-lpc-monitor.service etc/systemd/system

platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ systemctl start fstrim.timer
88
depmod -a
99
systemctl enable platform-modules-s6100.service
1010
systemctl start platform-modules-s6100.service
11+
12+
systemctl enable s6100-lpc-monitor.service
13+
systemctl start s6100-lpc-monitor.service
14+
1115
#DEBHELPER#

platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
z9100/scripts/check_qsfp.sh usr/local/bin
22
z9100/scripts/z9100_platform.sh usr/local/bin
33
common/dell_i2c_utils.sh usr/local/bin
4+
common/dell_lpc_mon.sh usr/local/bin
45
common/io_rd_wr.py usr/local/bin
56
common/fstrim.timer etc/systemd/system
67
common/fstrim.service etc/systemd/system
@@ -10,3 +11,4 @@ z9100/scripts/sensors usr/bin
1011
z9100/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_z9100_c2538-r0
1112
z9100/cfg/z9100-modules.conf etc/modules-load.d
1213
z9100/systemd/platform-modules-z9100.service etc/systemd/system
14+
z9100/systemd/z9100-lpc-monitor.service etc/systemd/system

platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.postinst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ systemctl enable platform-modules-z9100.service
1010
systemctl start platform-modules-z9100.service
1111

1212

13+
systemctl enable z9100-lpc-monitor.service
14+
systemctl start z9100-lpc-monitor.service
15+
1316
#DEBHELPER#
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Dell S6100 LPC bus monitoring poller
3+
DefaultDependencies=no
4+
5+
[Service]
6+
User=root
7+
ExecStart=/usr/local/bin/dell_lpc_mon.sh
8+
RemainAfterExit=yes
9+
10+
[Install]
11+
WantedBy=multi-user.target
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Dell Z9100 LPC bus monitoring poller
3+
DefaultDependencies=no
4+
5+
[Service]
6+
User=root
7+
ExecStart=/usr/local/bin/dell_lpc_mon.sh
8+
RemainAfterExit=yes
9+
10+
[Install]
11+
WantedBy=multi-user.target
12+

0 commit comments

Comments
 (0)