Linux block layer
 help / color / mirror / Atom feed
* [PATCH blktests] block/011: remove and rescan for evicted device
@ 2020-09-22  8:08 Klaus Jensen
  2020-09-23  6:41 ` Klaus Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Klaus Jensen @ 2020-09-22  8:08 UTC (permalink / raw)
  To: linux-block; +Cc: Omar Sandoval, Klaus Jensen, Keith Busch, Johannes Thumshirn

From: Klaus Jensen <k.jensen@samsung.com>

Devices that actually honor the Bus Master Enable bit and considers the
resulting failure to read/write a fatal error, often ends up getting
disabled by the kernel when running block/011.

Remove the device and rescan the pci bus after completing the test to
make sure we bring the device back up if required.

Cc: Keith Busch <kbusch@kernel.org>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 tests/block/011 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/block/011 b/tests/block/011
index 4f331b4a7522..f1306ae3896f 100755
--- a/tests/block/011
+++ b/tests/block/011
@@ -22,6 +22,7 @@ test_device() {
 	echo "Running ${TEST_NAME}"
 
 	pdev="$(_get_pci_dev_from_blkdev)"
+	sysfs="/sys/bus/pci/devices/${pdev}"
 
 	if _test_dev_is_rotational; then
 		size="32m"
@@ -42,4 +43,8 @@ test_device() {
 	done
 
 	echo "Test complete"
+
+	# bring the device back up if it was disabled by the kernel
+	echo 1 > "${sysfs}/remove"
+	echo 1 > /sys/bus/pci/rescan
 }
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-23  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22  8:08 [PATCH blktests] block/011: remove and rescan for evicted device Klaus Jensen
2020-09-23  6:41 ` Klaus Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox