The driver reached the PCU function's config space by walking the ACPI MCFG
table and mapping the ECAM page itself. That is one leaf driver deciding
config-space policy, and no other driver in mainline does it, so it was the
single most likely reason for a NAK.
Move that decision where it belongs: the upstream series is now two patches,
a PCI/x86 accessor that forces the memory-mapped path with the core's
locking, and this driver on top of it. Reviewers on each side now get
something they can act on, and get_maintainer.pl selects the PCI and x86
people by itself.
Correctness work in the same pass:
- the completion bits are latched, so a command the engine never accepted
was indistinguishable from a completed one and returned the previous
transaction's data as valid. Require a positive sign that the engine
acted on the command;
- compare the command registers after every transfer against what the
driver left in them and fail with -EAGAIN on a mismatch. The original
iMC driver had this check and it is what makes an unarbitrated system
detectable instead of silently wrong;
- use the i2c core's suspended-adapter mechanism rather than a private
flag and -EHOSTDOWN;
- use devm_mutex_init(), drop the unnecessary pci_enable_device(), and
return -ENODEV rather than -EPERM from the default-off gate, which was
printing a driver-core error on every boot;
- mask GO when restoring a saved command word.
Stop attributing the dropped CF8/CFC write to System Management Mode. The
only evidence was a boot log line naming the access method, which says
nothing about who filters the write. tools/probe-cf8-write.sh is there to
settle it with an MSR_SMI_COUNT measurement.
Add Documentation/i2c/busses/i2c-imc-skylake.rst, which every other PC SMBus
driver has and which was explicitly asked for on the 2020 iMC thread, the
tools/ scripts for the hardware measurements the submission still owes, and
compat/pci-mmcfg-compat.h so the driver still builds out-of-tree against a
kernel without the new accessor while the source stays byte-identical to the
submitted patch.
66 lines
1.6 KiB
Bash
Executable File
66 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Dump the PCU function's config space twice and report what moved on its own.
|
|
# Read-only. Used to look for a TSOD polling control register (see tools/README.md).
|
|
set -euo pipefail
|
|
|
|
# shellcheck source=tools/common.sh
|
|
source "$(dirname "$(readlink -f "$0")")/common.sh"
|
|
|
|
SETTLE=10
|
|
OUTDIR=${OUTDIR:-.}
|
|
|
|
while (($#)); do
|
|
case $1 in
|
|
--settle) SETTLE=$2; shift 2 ;;
|
|
--outdir) OUTDIR=$2; shift 2 ;;
|
|
-h|--help)
|
|
echo "usage: $0 [--settle SECONDS] [--outdir DIR]"
|
|
exit 0
|
|
;;
|
|
*) die "unknown argument: $1" ;;
|
|
esac
|
|
done
|
|
|
|
require_root
|
|
require_cmd lspci awk
|
|
|
|
BDF=$(find_pcu)
|
|
first=$(mktemp)
|
|
second=$(mktemp)
|
|
trap 'rm -f "$first" "$second"' EXIT
|
|
|
|
echo "device: $BDF"
|
|
if driver_is_loaded; then
|
|
echo "warning: i2c-imc-skylake is loaded; unload it first for a clean survey." >&2
|
|
fi
|
|
|
|
lspci -s "$BDF" -xxxx > "$first"
|
|
echo "first dump taken, waiting ${SETTLE}s..."
|
|
sleep "$SETTLE"
|
|
lspci -s "$BDF" -xxxx > "$second"
|
|
|
|
stamp=$(date +%Y%m%d-%H%M%S)
|
|
cp "$second" "$OUTDIR/pcu-config-$stamp.txt"
|
|
echo "full dump saved to $OUTDIR/pcu-config-$stamp.txt"
|
|
echo
|
|
|
|
echo "=== bytes that changed on their own over ${SETTLE}s ==="
|
|
if diff -u "$first" "$second" | grep -E '^[+-][0-9a-f]{3}:' ; then
|
|
echo
|
|
echo "A field with a steady cadence is the first candidate for a TSOD"
|
|
echo "polling control. Compare with the Broadwell-E driver's TSODCNTL (0xe0)."
|
|
else
|
|
echo "(none: the whole config space was stable)"
|
|
fi
|
|
echo
|
|
|
|
echo "=== engine registers ==="
|
|
snapshot_regs "$BDF"
|
|
echo
|
|
|
|
echo "=== neighbourhood of the Broadwell TSODCNTL offset (0xe0) ==="
|
|
awk '/^0[cdef]0:/ { print }' "$second"
|
|
echo
|
|
echo "=== the driver's register window (0x90-0xbf) ==="
|
|
awk '/^0[9ab]0:/ { print }' "$second"
|