diff mbox series

[i-g-t,3/8] lib: Restore the i915.reset modparam before cleaning up

Message ID 20190217143556.9482-3-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t,1/8] i915/gem_eio: Check that context create fails when wedged | expand

Commit Message

Chris Wilson Feb. 17, 2019, 2:35 p.m. UTC
We force a reset on test exit so that we can rapidly cleanup after a
naughty test, it is not unknown for us to leave a queue of hanging
batches around. However, if we have also fiddled with the i915.reset
parameter in the meantime, this can leave the kernel unable to fulfil
our request (and those naughty batches continue to disrupt testing).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 lib/drmtest.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Antonio Argenziano Feb. 19, 2019, 6:22 p.m. UTC | #1
On 17/02/19 06:35, Chris Wilson wrote:
> We force a reset on test exit so that we can rapidly cleanup after a
> naughty test, it is not unknown for us to leave a queue of hanging
> batches around. However, if we have also fiddled with the i915.reset
> parameter in the meantime, this can leave the kernel unable to fulfil

typo -------------------------------------------------------------^

> our request (and those naughty batches continue to disrupt testing).
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>

Re-enabling reset sounds good.

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

> ---
>   lib/drmtest.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 1964795a6..6c0a0e381 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -54,6 +54,7 @@
>   #include "igt_device.h"
>   #include "igt_gt.h"
>   #include "igt_kmod.h"
> +#include "igt_sysfs.h"
>   #include "version.h"
>   #include "config.h"
>   #include "intel_reg.h"
> @@ -345,6 +346,7 @@ static void __cancel_work_at_exit(int fd)
>   {
>   	igt_terminate_spin_batches(); /* for older kernels */
>   
> +	igt_sysfs_set_parameter(fd, "reset", "%x", -1u /* any method */);
>   	igt_drop_caches_set(fd,
>   			    /* cancel everything */
>   			    DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
>
Chris Wilson Feb. 19, 2019, 9:03 p.m. UTC | #2
Quoting Antonio Argenziano (2019-02-19 18:22:26)
> 
> 
> On 17/02/19 06:35, Chris Wilson wrote:
> > We force a reset on test exit so that we can rapidly cleanup after a
> > naughty test, it is not unknown for us to leave a queue of hanging
> > batches around. However, if we have also fiddled with the i915.reset
> > parameter in the meantime, this can leave the kernel unable to fulfil
> 
> typo -------------------------------------------------------------^

I'm Chiefly British still. So just the one 'l' is enough to fulfil me.
-Chris
diff mbox series

Patch

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 1964795a6..6c0a0e381 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -54,6 +54,7 @@ 
 #include "igt_device.h"
 #include "igt_gt.h"
 #include "igt_kmod.h"
+#include "igt_sysfs.h"
 #include "version.h"
 #include "config.h"
 #include "intel_reg.h"
@@ -345,6 +346,7 @@  static void __cancel_work_at_exit(int fd)
 {
 	igt_terminate_spin_batches(); /* for older kernels */
 
+	igt_sysfs_set_parameter(fd, "reset", "%x", -1u /* any method */);
 	igt_drop_caches_set(fd,
 			    /* cancel everything */
 			    DROP_RESET_ACTIVE | DROP_RESET_SEQNO |