Im testing a raidcard which uses PCIe link with my server. As there are two protocol ways about linkdown in pcie protocol:linkdisable/hotreset. I didn
t found any reasonable way to both do the reset and make a noticafication to the kernel. so i choose to use “setpci” tool to do this,such as triggering a hotreset:
bc=$(setpci -s $port BRIDGE_CONTROL)
echo “Bridge control:” $bc
setpci -s $port BRIDGE_CONTROL=$(printf “%04x” $((“0x$bc” | 0x40)))
sleep 0.01
setpci -s $port BRIDGE_CONTROL=$bc
but linus kernel will not sense this linkdown, thus the card driver do not sence the device is unavailable as well.
when I try to reprobe my card via the driver, software have to wait io queue timeout then trigger host reset, the queue timout is 60s so I have to wait at least 60s to complete the reprobe process.
I want to know if there is any reasonable way in Linux to both do the reset and make a noticafication to the kernel such as flr using “/sys/bus/pci/devices/$dev/reset” so that card drvier could get the linkdown status and reprobe my card faster?