2 # SPDX-License-Identifier: GPL-2.0-only
6 eeh_test_prep # NB: may exit
11 # record the devices that we break in here. Assuming everything
12 # goes to plan we should get them back once the recover process
16 # Build up a list of candidate devices.
17 for dev in `ls -1 /sys/bus/pci/devices/ | grep '\.0$'` ; do
18 if ! eeh_can_break $dev ; then
22 # Skip VFs for now since we don't have a reliable way to break them.
23 if [ -e "/sys/bus/pci/devices/$dev/physfn" ] ; then
24 echo "$dev, Skipped: virtfn"
30 # Add to this list of device to check
31 devices="$devices $dev"
34 dev_count="$(echo $devices | wc -w)"
35 echo "Found ${dev_count} breakable devices..."
38 for dev in $devices ; do
39 echo "Breaking $dev..."
41 if ! pe_ok $dev ; then
42 echo "Skipping $dev, Initial PE state is not ok"
43 failed="$((failed + 1))"
47 if ! eeh_one_dev $dev ; then
48 failed="$((failed + 1))"
52 echo "$failed devices failed to recover ($dev_count tested)"
53 lspci | diff -u $pre_lspci -