forked from markjdb/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpcie-clearerrmask
More file actions
executable file
·46 lines (36 loc) · 843 Bytes
/
pcie-clearerrmask
File metadata and controls
executable file
·46 lines (36 loc) · 843 Bytes
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
#!/bin/sh
warn()
{
echo "$(basename ${0}): $1" 1>&2
}
err()
{
warn "$1"
exit 1
}
pcieroot_regread()
{
pciconf -r pci0:0:0:0 $1 2>/dev/null
}
pcieroot_regclear()
{
pciconf -w pci0:0:0:0 $1 0
}
doit()
{
echo "clearing $1 - original value was $(pcieroot_regread ${2})"
pcieroot_regclear $2
}
which pciconf >/dev/null 2>&1 || err "This script only works on FreeBSD."
[ $(id -u) -eq 0 ] || err "This script must be run as root."
if ! dmesg | grep -q -e '^rasum:.*Jasper Forest' -e '^rasum:.*Sandy Bridge'; then
warn "This script probably won't work on this platform, but we'll try anyway."
fi
warn "Attempting to clear error masks."
doit XPCORERRMSK 0x204
doit XPUNCERRMSK 0x20C
doit UNCEDMASK 0x218
doit COREDMASK 0x21C
doit RPEDMASK 0x220
doit XPUNCEDMASK 0x224
doit XPCOREDMASK 0x228