It turns out some PCIe slots report hotplug surprise but are not hotplug
capable. Despite the contridiction, the spec seems to allow that.
The linux pciehp driver needs hotplug capable to bind to the slot, and
the block/019 test requires hotplug surprise to handle the unannounced
link-down. Verify both bits in the slot capabilities register are set.
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
local slt_cap
slt_cap="$(setpci -s "${parent}" CAP_EXP+14.w)"
- if [[ $((0x${slt_cap} & 0x20)) -eq 0 ]]; then
+ if [[ $((0x${slt_cap} & 0x60)) -ne 0x60 ]]; then
SKIP_REASON="$TEST_DEV is not in a hot pluggable slot"
return 1
fi