]> www.infradead.org Git - users/sagi/blktests.git/commit
Add surprise removal block test
authorKeith Busch <keith.busch@intel.com>
Thu, 26 Apr 2018 22:52:24 +0000 (16:52 -0600)
committerOmar Sandoval <osandov@fb.com>
Thu, 26 Apr 2018 23:30:40 +0000 (16:30 -0700)
commit28a159636c07231d0216b1660dd0ef31da7dd1ce
tree293bfe0782c598f7c2e00e1245f7f1ef4d14bc11
parent345f07634c648956fe74438b5727780187dadb28
Add surprise removal block test

This test is for PCI devices in a surprise remove capable slot and tests
how well the drivers and kernel handle losing the link to that device.

The test finds the PCI Express Capability register of the pci slot a block
device is in, then at offset 0x10 (the Link Control Register) writes a 1
to bit 4 (Link Disable). This occurs unbeknownst to any of the drivers,
just like a surprise removal. Drivers will find out about this through
the pcie hotplug handler, at which point it's too late to communicate
with the device, therfore testing how well we cope with the condition.

The link is reenabled at the end of the test.

Note, this is currently incompatible with NVMe Subsystems when
CONFIG_NVME_MULTIPATH since the /dev/nvme*n* names don't have a pci
parent in sysfs.

Signed-off-by: Keith Busch <keith.busch@intel.com>
common/rc
tests/block/019 [new file with mode: 0755]
tests/block/019.out [new file with mode: 0644]