diff mbox series

[i-g-t,3/3] igt/drv_missed_irq: Skip if the kernel reports no rings available to test

Message ID 20190116093509.30195-3-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t,1/3] i915/gem_userptr_blits: Only mlock the memfd once, not the arena | expand

Commit Message

Chris Wilson Jan. 16, 2019, 9:35 a.m. UTC
Some setups (e.g. guc and gen10+) can not disable the MI_USER_INTERRUPT
generation and so can not simulate missed interrupts. These tests would
fail, so skip when the kernel reports no tests available.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_gt.c            | 2 +-
 tests/i915/missed_irq.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Mika Kuoppala Jan. 16, 2019, 2:30 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Some setups (e.g. guc and gen10+) can not disable the MI_USER_INTERRUPT
> generation and so can not simulate missed interrupts. These tests would
> fail, so skip when the kernel reports no tests available.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  lib/igt_gt.c            | 2 +-
>  tests/i915/missed_irq.c | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> index a20619246..dd28d821d 100644
> --- a/lib/igt_gt.c
> +++ b/lib/igt_gt.c
> @@ -535,7 +535,7 @@ unsigned intel_detect_and_clear_missed_interrupts(int fd)
>  	dir = igt_debugfs_dir(fd);
>  
>  	missed = 0;
> -	igt_assert(igt_sysfs_scanf(dir, "i915_ring_missed_irq", "%x", &missed) == 1);
> +	igt_sysfs_scanf(dir, "i915_ring_missed_irq", "%x", &missed);
>  	if (missed)
>  		igt_sysfs_set(dir, "i915_ring_missed_irq", "0");
>  
> diff --git a/tests/i915/missed_irq.c b/tests/i915/missed_irq.c
> index 78690c36a..cade3f371 100644
> --- a/tests/i915/missed_irq.c
> +++ b/tests/i915/missed_irq.c
> @@ -113,6 +113,7 @@ igt_simple_main
>  	debugfs = igt_debugfs_dir(device);
>  
>  	expect_rings = engine_mask(debugfs);
> +	igt_require(expect_rings);
>  
>  	igt_debug("Clearing rings %x\n", expect_rings);
>  	intel_detect_and_clear_missed_interrupts(device);
> -- 
> 2.20.1
diff mbox series

Patch

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index a20619246..dd28d821d 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -535,7 +535,7 @@  unsigned intel_detect_and_clear_missed_interrupts(int fd)
 	dir = igt_debugfs_dir(fd);
 
 	missed = 0;
-	igt_assert(igt_sysfs_scanf(dir, "i915_ring_missed_irq", "%x", &missed) == 1);
+	igt_sysfs_scanf(dir, "i915_ring_missed_irq", "%x", &missed);
 	if (missed)
 		igt_sysfs_set(dir, "i915_ring_missed_irq", "0");
 
diff --git a/tests/i915/missed_irq.c b/tests/i915/missed_irq.c
index 78690c36a..cade3f371 100644
--- a/tests/i915/missed_irq.c
+++ b/tests/i915/missed_irq.c
@@ -113,6 +113,7 @@  igt_simple_main
 	debugfs = igt_debugfs_dir(device);
 
 	expect_rings = engine_mask(debugfs);
+	igt_require(expect_rings);
 
 	igt_debug("Clearing rings %x\n", expect_rings);
 	intel_detect_and_clear_missed_interrupts(device);