public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang
@ 2019-02-21 10:19 Chris Wilson
  2019-02-21 10:19 ` [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed Chris Wilson
  2019-02-21 16:08 ` [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Antonio Argenziano
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2019-02-21 10:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

To control hang detection, we manipulate the i915.reset module
parameter. However, to be nice we should SKIP if we cannot modify the
parameter as opposed to outright FAILing.

References: https://bugs.freedesktop.org/show_bug.cgi?id=108891
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_gt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 646696727..c98a7553b 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -176,8 +176,8 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
 	if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
 		igt_require(has_gpu_reset(fd));
 
-	igt_assert(igt_sysfs_set_parameter
-		   (fd, "reset", "%d", INT_MAX /* any reset method */));
+	igt_require(igt_sysfs_set_parameter
+		    (fd, "reset", "%d", INT_MAX /* any reset method */));
 
 	if ((flags & HANG_ALLOW_CAPTURE) == 0) {
 		param.param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed
  2019-02-21 10:19 [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Chris Wilson
@ 2019-02-21 10:19 ` Chris Wilson
  2019-02-21 16:11   ` [igt-dev] " Antonio Argenziano
  2019-02-21 16:08 ` [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Antonio Argenziano
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2019-02-21 10:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

If we tell the machine to reset but they are disallowed, we will leave
the system in a wedged state, preventing the majority of subsequent
tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/i915_hangman.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index df1e0afed..4e515e3a0 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -257,6 +257,7 @@ static void hangcheck_unterminated(void)
 igt_main
 {
 	const struct intel_execution_engine *e;
+	igt_hang_t hang = {};
 
 	igt_skip_on_simulation();
 
@@ -266,6 +267,8 @@ igt_main
 		device = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(device);
 
+		hang = igt_allow_hang(device, 0, HANG_ALLOW_CAPTURE);
+
 		sysfs = igt_sysfs_open(device, &idx);
 		igt_assert(sysfs != -1);
 
@@ -288,4 +291,8 @@ igt_main
 
 	igt_subtest("hangcheck-unterminated")
 		hangcheck_unterminated();
+
+	igt_fixture {
+		igt_disallow_hang(device, hang);
+	}
 }
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang
  2019-02-21 10:19 [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Chris Wilson
  2019-02-21 10:19 ` [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed Chris Wilson
@ 2019-02-21 16:08 ` Antonio Argenziano
  2019-02-21 16:11   ` Chris Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: Antonio Argenziano @ 2019-02-21 16:08 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev



On 21/02/19 02:19, Chris Wilson wrote:
> To control hang detection, we manipulate the i915.reset module
> parameter. However, to be nice we should SKIP if we cannot modify the
> parameter as opposed to outright FAILing.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=108891
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   lib/igt_gt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> index 646696727..c98a7553b 100644
> --- a/lib/igt_gt.c
> +++ b/lib/igt_gt.c
> @@ -176,8 +176,8 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
>   	if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
>   		igt_require(has_gpu_reset(fd));
>   
> -	igt_assert(igt_sysfs_set_parameter
> -		   (fd, "reset", "%d", INT_MAX /* any reset method */));
> +	igt_require(igt_sysfs_set_parameter
> +		    (fd, "reset", "%d", INT_MAX /* any reset method */));

How come we were not able to write that parameter? Isn't that sysfs 
always there?

Antonio

>   
>   	if ((flags & HANG_ALLOW_CAPTURE) == 0) {
>   		param.param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE;
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang
  2019-02-21 16:08 ` [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Antonio Argenziano
@ 2019-02-21 16:11   ` Chris Wilson
  2019-02-21 16:16     ` Antonio Argenziano
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2019-02-21 16:11 UTC (permalink / raw)
  To: Antonio Argenziano, intel-gfx; +Cc: igt-dev

Quoting Antonio Argenziano (2019-02-21 16:08:04)
> 
> 
> On 21/02/19 02:19, Chris Wilson wrote:
> > To control hang detection, we manipulate the i915.reset module
> > parameter. However, to be nice we should SKIP if we cannot modify the
> > parameter as opposed to outright FAILing.
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=108891
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >   lib/igt_gt.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> > index 646696727..c98a7553b 100644
> > --- a/lib/igt_gt.c
> > +++ b/lib/igt_gt.c
> > @@ -176,8 +176,8 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
> >       if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
> >               igt_require(has_gpu_reset(fd));
> >   
> > -     igt_assert(igt_sysfs_set_parameter
> > -                (fd, "reset", "%d", INT_MAX /* any reset method */));
> > +     igt_require(igt_sysfs_set_parameter
> > +                 (fd, "reset", "%d", INT_MAX /* any reset method */));
> 
> How come we were not able to write that parameter? Isn't that sysfs 
> always there?

No. It can be compiled out.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed
  2019-02-21 10:19 ` [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed Chris Wilson
@ 2019-02-21 16:11   ` Antonio Argenziano
  0 siblings, 0 replies; 6+ messages in thread
From: Antonio Argenziano @ 2019-02-21 16:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev



On 21/02/19 02:19, Chris Wilson wrote:
> If we tell the machine to reset but they are disallowed, we will leave
> the system in a wedged state, preventing the majority of subsequent
> tests.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

LGTM.

Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

> ---
>   tests/i915/i915_hangman.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
> index df1e0afed..4e515e3a0 100644
> --- a/tests/i915/i915_hangman.c
> +++ b/tests/i915/i915_hangman.c
> @@ -257,6 +257,7 @@ static void hangcheck_unterminated(void)
>   igt_main
>   {
>   	const struct intel_execution_engine *e;
> +	igt_hang_t hang = {};
>   
>   	igt_skip_on_simulation();
>   
> @@ -266,6 +267,8 @@ igt_main
>   		device = drm_open_driver(DRIVER_INTEL);
>   		igt_require_gem(device);
>   
> +		hang = igt_allow_hang(device, 0, HANG_ALLOW_CAPTURE);
> +
>   		sysfs = igt_sysfs_open(device, &idx);
>   		igt_assert(sysfs != -1);
>   
> @@ -288,4 +291,8 @@ igt_main
>   
>   	igt_subtest("hangcheck-unterminated")
>   		hangcheck_unterminated();
> +
> +	igt_fixture {
> +		igt_disallow_hang(device, hang);
> +	}
>   }
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang
  2019-02-21 16:11   ` Chris Wilson
@ 2019-02-21 16:16     ` Antonio Argenziano
  0 siblings, 0 replies; 6+ messages in thread
From: Antonio Argenziano @ 2019-02-21 16:16 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev



On 21/02/19 08:11, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-02-21 16:08:04)
>>
>>
>> On 21/02/19 02:19, Chris Wilson wrote:
>>> To control hang detection, we manipulate the i915.reset module
>>> parameter. However, to be nice we should SKIP if we cannot modify the
>>> parameter as opposed to outright FAILing.
>>>
>>> References: https://bugs.freedesktop.org/show_bug.cgi?id=108891
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> ---
>>>    lib/igt_gt.c | 4 ++--
>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
>>> index 646696727..c98a7553b 100644
>>> --- a/lib/igt_gt.c
>>> +++ b/lib/igt_gt.c
>>> @@ -176,8 +176,8 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
>>>        if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
>>>                igt_require(has_gpu_reset(fd));
>>>    
>>> -     igt_assert(igt_sysfs_set_parameter
>>> -                (fd, "reset", "%d", INT_MAX /* any reset method */));
>>> +     igt_require(igt_sysfs_set_parameter
>>> +                 (fd, "reset", "%d", INT_MAX /* any reset method */));
>>
>> How come we were not able to write that parameter? Isn't that sysfs
>> always there?
> 
> No. It can be compiled out.

Right...

Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

> -Chris
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2019-02-21 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-21 10:19 [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Chris Wilson
2019-02-21 10:19 ` [PATCH i-g-t 2/2] igt/drv_hangman: Skip if resets are disallowed Chris Wilson
2019-02-21 16:11   ` [igt-dev] " Antonio Argenziano
2019-02-21 16:08 ` [PATCH i-g-t 1/2] lib: Only require we have i915.reset module parameter for allow-hang Antonio Argenziano
2019-02-21 16:11   ` Chris Wilson
2019-02-21 16:16     ` Antonio Argenziano

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