Re: [igt-dev] [PATCH i-g-t v2] igt/drv_module_reload: Revamp fault-injection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Antonio Argenziano (2018-06-06 21:48:22)
> 
> 
> On 06/06/18 10:42, Chris Wilson wrote:
> > The current method of checking for a failed module load is flawed, as we
> > only report the error on probing it is not being reported back by
> > modprobe. So we have to dig inside the module_parameters while the
> > module is still loaded to discover the error.
> > 
> > v2: Expect i915.inject_load_failure to be zero on success
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> > Cc: Imre Deak <imre.deak@xxxxxxxxx>
> > Reviewed-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> > ---
> >   tests/drv_module_reload.c | 45 ++++++++++++++++++++++++++++++++++-----
> >   1 file changed, 40 insertions(+), 5 deletions(-)
> > 
> > diff --git a/tests/drv_module_reload.c b/tests/drv_module_reload.c
> > index 092982960..e18aaea5e 100644
> > --- a/tests/drv_module_reload.c
> > +++ b/tests/drv_module_reload.c
> > @@ -234,6 +234,38 @@ reload(const char *opts_i915)
> >       return err;
> >   }
> >   
> 
> >   static void
> >   gem_sanitycheck(void)
> >   {
> > @@ -323,12 +355,15 @@ igt_main
> >               igt_assert_eq(reload("disable_display=1"), 0);
> >   
> >       igt_subtest("basic-reload-inject") {
> > -             char buf[64];
> >               int i = 0;
> > -             do {
> > -                     snprintf(buf, sizeof(buf),
> > -                              "inject_load_failure=%d", ++i);
> > -             } while (reload(buf));
> > +
> > +             igt_i915_driver_unload();
> > +
> > +             while (inject_fault("i915", "inject_load_failure", ++i) == 0)
> > +                     ;
> > +
> > +             /* We expect to hit at least one fault! */
> > +             igt_assert(i > 1);
> 
> I think Michal's patch adds the number of available checkpoints in a 
> debugfs, should we trust the driver and assert on: amount of checkpoints 
> hit != available checkpoints? Or maybe just spew out a warning.

This loop hits all the fault points you can hit. There is nothing more
the driver nor igt can do. The only assertion we have there is to 
basically catch the case where the protocol fails, or there are no fault
points built into the driver.

That is trusting the driver less than expecting it to report the exact
number of reachable fault points.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux