2019-07-15 12:33:35 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
dev=$1
|
|
|
|
|
|
|
|
if [ -z "$dev" ]; then
|
|
|
|
echo "Error: no device specified"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
|
|
|
|
dev="0000:$dev"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
|
|
|
|
echo "Error: device $dev not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
port=$(basename $(dirname $(readlink "/sys/bus/pci/devices/$dev")))
|
|
|
|
|
|
|
|
if [ ! -e "/sys/bus/pci/devices/$port" ]; then
|
|
|
|
echo "Error: device $port not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Disabling fatal error reporting on port $port..."
|
|
|
|
|
2022-04-19 23:18:50 -07:00
|
|
|
echo "Command:" $(setpci -s $port COMMAND)
|
2019-07-15 12:33:35 -07:00
|
|
|
|
|
|
|
# clear SERR bit in command register
|
2022-04-19 23:18:50 -07:00
|
|
|
setpci -s $port COMMAND=0000:0100
|
2019-07-15 12:33:35 -07:00
|
|
|
|
2022-04-19 23:18:50 -07:00
|
|
|
echo "Command:" $(setpci -s $port COMMAND)
|
2019-07-15 12:33:35 -07:00
|
|
|
|
2022-04-19 23:18:50 -07:00
|
|
|
echo "Device control:" $(setpci -s $port CAP_EXP+8.w)
|
2019-07-15 12:33:35 -07:00
|
|
|
|
|
|
|
# clear fatal error reporting enable bit in device control register
|
2022-04-19 23:18:50 -07:00
|
|
|
setpci -s $port CAP_EXP+8.w=0000:0004
|
2019-07-15 12:33:35 -07:00
|
|
|
|
2022-04-19 23:18:50 -07:00
|
|
|
echo "Device control:" $(setpci -s $port CAP_EXP+8.w)
|