[Intel-gfx] [PATCH igt] lib: Force global reset + uevents for hang detector

Chris Wilson chris at chris-wilson.co.uk
Mon Jun 5 12:00:06 UTC 2017


Quoting Mika Kuoppala (2017-06-05 12:15:15)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > The hang detector relies on a uevent for notification and aborting the
> > test. As proposed, fine-grained resets may not produce a global uevent
> > and so this hang detection becomes void. As we don't expect any hang, we
> > can just reduce the reset to only a global + uevent and so maintain
> > functionality, and switch back to fine-grained resets afterwards.
> >
> > Note that any test that requires testing fine-grained resets should
> > ensure that they are enabled first as igt may leave the global
> > parameters in an inconsistent state.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > cc: Michel Thierr <michel.thierry at intel.com>
> +y
> 
> > ---
> >  lib/igt_aux.c | 23 +++++++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> >
> > diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> > index 1222806c..ca2feac3 100644
> > --- a/lib/igt_aux.c
> > +++ b/lib/igt_aux.c
> > @@ -60,6 +60,7 @@
> >  #include "igt_debugfs.h"
> >  #include "igt_gt.h"
> >  #include "igt_rand.h"
> > +#include "igt_sysfs.h"
> >  #include "config.h"
> >  #include "intel_reg.h"
> >  #include "ioctl_wrappers.h"
> > @@ -443,12 +444,34 @@ static void sig_abort(int sig)
> >       igt_assert(!"GPU hung");
> >  }
> >  
> > +static bool set_parameter(int fd, const char *parameter, int value)
> > +{
> > +     int dir;
> > +
> > +     dir = igt_sysfs_open_parameters(fd);
> > +     if (dir < 0)
> > +             return false;
> > +
> > +     igt_sysfs_printf(dir, parameter, "%d", value);
> > +     close(dir);
> > +
> > +     return true;
> > +}
> > +
> >  void igt_fork_hang_detector(int fd)
> >  {
> >       struct stat st;
> >  
> >       igt_assert(fstat(fd, &st) == 0);
> >  
> > +     /*
> > +      * Disable per-engine reset to force an error uevent. We don't
> > +      * expect to get any hangs whilst the detector is enabled (if we do
> > +      * they are a test failure!) and so the loss of per-engine reset
> > +      * functionality is not an issue.
> > +      */
> 
> Makes sense. Tho I only looked one test which disables
> hang detector before starting the more fine grained hang tests.

I did at first do a set_parameter("reset", INT_MAX) on
stop_hang_detector, but lacked the fd and didn't face wiring it up. So I
decided that any test that actually wants to test per-engine resets
should take of enabling per-engine resets first.

I guess igt_allow_hang() should do the inverse. That makes sense to me.
-Chris


More information about the Intel-gfx mailing list