[PATCH i-g-t] tests/device_reset: Cold reset doesn't depend on PCI reset

Janusz Krzysztofik <[email protected]>
Newsgroups org.freedesktop.lists.intel-gfx
Message-ID <[email protected]>
Before commit 59e3bf83f6bae ("tests/device_reset: Add cold reset IGT
test") all subtests required device PCI reset capability, with that
dependency placed in an initial igt_fixture section.  New subtests
introduced with that commit didn't depend on that capability but that
requirement was left untouched.  That was OK as long as all devices
being tested supported a PCI reset method, however, that's going to
change with an upcoming kernel patch that addresses DG1 SKU 0x4905
inability to perform a PCI reset without breaking the device.

Move the requirement from the initial igt_fixture section to the
relevant subtest bodies, so cold reset subtest can be run even if PCI
reset is not supported.  See commit 4a5fd4e7cb279 ("tests/device_reset:
move later skips into subtests") for justification on why not to use
an igt_fixture inside an igt_subtest_group for that purpose.

Signed-off-by: Janusz Krzysztofik <[email protected]>
---
 tests/device_reset.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/device_reset.c b/tests/device_reset.c
index b281f4eceb..c9ee297e8d 100644
--- a/tests/device_reset.c
+++ b/tests/device_reset.c
@@ -453,24 +453,25 @@ int igt_main()
 		/* Make sure subtests always reopen the same device */
 		igt_assert(device_sysfs_path(dev.fds.dev, dev_path));
 		set_device_filter(dev_path);
-
-		igt_skip_on(!is_sysfs_reset_supported(dev.fds.dev));
 	}
 
 	igt_describe("Unbinds driver from device, initiates reset"
 		     " then rebinds driver to device");
 	igt_subtest("unbind-reset-rebind") {
+		igt_skip_on(!is_sysfs_reset_supported(dev.fds.dev));
+
 		unbind_reset_rebind(&dev, FLR_RESET);
 		healthcheck(&dev);
 	}
 
 	igt_describe("Resets device with bound driver");
 	igt_subtest("reset-bound") {
+		igt_skip_on(!is_sysfs_reset_supported(dev.fds.dev));
+
 		initiate_device_reset(&dev, FLR_RESET);
 		healthcheck(&dev);
 	}
 
-
 	igt_subtest_group() {
 		igt_describe("Unbinds driver from device, initiates cold reset"
 			     " then rebinds driver to device");
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.