[Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 31 13:31:13 UTC 2020


Quoting Mika Kuoppala (2020-01-31 13:22:38)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > If the heartbeat fires in the middle of the preempt-hang test, it
> > consumes our forced hang disrupting the test.
> >
> > Reported-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/gt/selftest_lrc.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > index 5e04ecb61dcc..f5214a374fb7 100644
> > --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > @@ -2452,15 +2452,19 @@ static int live_preempt_hang(void *arg)
> >               I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY);
> >  
> >       for_each_engine(engine, gt, id) {
> > +             unsigned long heartbeat;
> >               struct i915_request *rq;
> >  
> >               if (!intel_engine_has_preemption(engine))
> >                       continue;
> >  
> > +             engine_heartbeat_disable(engine, &heartbeat);
> > +
> >               rq = spinner_create_request(&spin_lo, ctx_lo, engine,
> >                                           MI_ARB_CHECK);
> >               if (IS_ERR(rq)) {
> >                       err = PTR_ERR(rq);
> > +                     engine_heartbeat_enable(engine, heartbeat);
> 
> Was thinking that you could grab the engine and abuse then the error
> path to enable.
> 
> But too hairy.

Yeah, we've done staggered error paths, but both look ugly, So I took
the easy approach. Move the inner loop to its own test function usually
helps though.
-Chris


More information about the Intel-gfx mailing list