sonic-buildimage/platform/broadcom/sonic-platform-modules-dell/common/dell_lpc_mon.sh
Sudharsan D.G 2e40fa5dbe [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.
2019-06-24 08:13:40 -07:00

47 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
REV=$(lspci -xxx -s 0:0.0 | grep rev | awk -F 'rev ' '{print $2}' | sed 's/)//')
if [ $REV -gt 2 ]
then
exit 0
fi
test_val=(55 aa)
num_val=${#test_val[@]}
index=0
poll_interval=300
cpld_scratch_reg=0x102
smf_scratch_reg=0x202
function log_crit() {
local msg=$1
`logger -p user.crit -t DELL_LPC_BUS_MON $msg`
}
function validate_lpc() {
local reg=$1
local val=$2
local reg_str="CPLD scratch register"
if [ $reg == $smf_scratch_reg ]
then
reg_str="SMF scratch register"
fi
io_rd_wr.py --set --val $val --offset $reg
get_val=$(io_rd_wr.py --get --offset $reg | cut -d " " -f3)
if [ $val != $get_val ]
then
log_crit "LPC bus has deteriorated on this unit. \
$reg_str has value $get_val while expected is $val \
Please contact technical support"
fi
}
while true
do
val=${test_val[$index]}
validate_lpc $cpld_scratch_reg $val
validate_lpc $smf_scratch_reg $val
index=$(((index+1)%num_val))
sleep $poll_interval
done