diff --git a/lib/drmtest.c b/lib/drmtest.c index 16e80bdfcfb1c0428e7aa8761e0b16680c3c1a4c..8e2d1ac50b13b09ec1428c338219dffd0b8d08c8 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -260,7 +260,7 @@ static bool _is_already_opened(const char *path, int as_idx) * we cannot even stat the device, so it's of no use - let's claim it's * already opened */ - if (stat(path, &new) != 0) + if (igt_debug_on(stat(path, &new) != 0)) return true; for (int i = 0; i < as_idx; ++i) { diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c index 8b767eed202d6a1ebba7569143a07deff4b239fd..ae69ed09f10ad931d4839396c0afdaea65e9dbde 100644 --- a/lib/igt_device_scan.c +++ b/lib/igt_device_scan.c @@ -1918,6 +1918,10 @@ static bool __igt_device_card_match(const char *filter, return false; memset(card, 0, sizeof(*card)); + /* + * Scan devices in case the user hasn't yet, + * but leave a decision on forced rescan on the user side. + */ igt_devices_scan(false); if (igt_device_filter_apply(filter) == false) diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c index 815f1c8a2c7ff910221ada326bb74f137cbb4f8f..1d304a93179c32057acb5fccfe1c709f991d70cf 100644 --- a/tests/i915/i915_suspend.c +++ b/tests/i915/i915_suspend.c @@ -253,8 +253,18 @@ igt_main igt_subtest("basic-s3-without-i915") test_suspend_without_i915(SUSPEND_STATE_S3); - igt_fixture + igt_fixture { + /* + * Since above subtests may fail, leaving i915 module unloaded + * but device list populated, refresh the device list before + * reopening the i915 device if we've been called with a device + * filter specified, otherwise drm_open_driver() will fail + * instead of reloading the i915 module. + */ + if (igt_device_filter_count()) + igt_devices_scan(true); fd = drm_open_driver(DRIVER_INTEL); + } igt_subtest("fence-restore-tiled2untiled") { gem_require_mappable_ggtt(fd);