Re: [PATCH] drm/i915: Check for an invalid seqno before __i915_gem_request_started

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

 



On Wed, Mar 08, 2017 at 02:45:16PM +0000, Tvrtko Ursulin wrote:
> 
> On 08/03/2017 14:22, Chris Wilson wrote:
> >__i915_gem_request_started() asserts that the seqno is valid, but
> >i915_spin_request() was not checking before querying whether the request
> >had started.
> >
> >Reported-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> >Fixes: 754c9fd57649 ("drm/i915: Protect the request->global_seqno with the engine->timeline lock")
> >Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> >Cc: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> >---
> > drivers/gpu/drm/i915/i915_gem_request.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
> >index 6fdfb801bcee..cb4e7f3e279e 100644
> >--- a/drivers/gpu/drm/i915/i915_gem_request.h
> >+++ b/drivers/gpu/drm/i915/i915_gem_request.h
> >@@ -348,6 +348,9 @@ static inline bool i915_spin_request(const struct drm_i915_gem_request *request,
> > 	u32 seqno;
> >
> > 	seqno = i915_gem_request_global_seqno(request);
> >+	if (!seqno)
> >+		return 0;
> >+
> > 	return (__i915_gem_request_started(request, seqno) &&
> > 		__i915_spin_request(request, seqno, state, timeout_us));
> > }
> >
> 
> Looks equivalent to just calling i915_gem_request_started instead of
> __i915_gem_request_started.

We want to pass the same seqno onto __i915_spin_request, but yeah, very
similar.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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