public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 09/10] drm/i915: Only signal from interrupt when requested
Date: Wed, 17 Jan 2018 12:22:33 +0000	[thread overview]
Message-ID: <a2894bed-9e67-df0e-cded-ba0d1633caf6@linux.intel.com> (raw)
In-Reply-To: <20180115212455.24046-10-chris@chris-wilson.co.uk>


On 15/01/2018 21:24, Chris Wilson wrote:
> Avoid calling dma_fence_signal() from inside the interrupt if we haven't
> enabled signaling on the request.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_gem_request.c | 2 +-
>   drivers/gpu/drm/i915/i915_irq.c         | 3 ++-
>   drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++---
>   3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 08bbd56277e5..46848aef1648 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -1214,7 +1214,7 @@ long i915_wait_request(struct drm_i915_gem_request *req,
>   	if (flags & I915_WAIT_LOCKED)
>   		add_wait_queue(errq, &reset);
>   
> -	intel_wait_init(&wait, req);
> +	intel_wait_init(&wait);
>   
>   restart:
>   	do {
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index e5f76d580010..ea290f102784 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1093,7 +1093,8 @@ static void notify_ring(struct intel_engine_cs *engine)
>   		if (i915_seqno_passed(seqno, wait->seqno)) {
>   			struct drm_i915_gem_request *waiter = wait->request;
>   
> -			if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
> +			if (waiter &&
> +			    !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
>   				      &waiter->fence.flags) &&
>   			    intel_wait_check_request(wait, waiter))
>   				rq = i915_gem_request_get(waiter);
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index f406d0ff4612..cea2092d25d9 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -874,11 +874,10 @@ static inline u32 intel_hws_preempt_done_address(struct intel_engine_cs *engine)
>   /* intel_breadcrumbs.c -- user interrupt bottom-half for waiters */
>   int intel_engine_init_breadcrumbs(struct intel_engine_cs *engine);
>   
> -static inline void intel_wait_init(struct intel_wait *wait,
> -				   struct drm_i915_gem_request *rq)
> +static inline void intel_wait_init(struct intel_wait *wait)
>   {
>   	wait->tsk = current;
> -	wait->request = rq;
> +	wait->request = NULL;

Unless it is in this patch series, I can't see that this now leaves any 
code path which sets wait->request?

It's strange anyway - is this guarding against null ptr deref or what?

Regards,

Tvrtko

>   }
>   
>   static inline void intel_wait_init_for_seqno(struct intel_wait *wait, u32 seqno)
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-01-17 12:22 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 21:24 Prevent trivial oom from gem_exec_nop/sequential Chris Wilson
2018-01-15 21:24 ` [PATCH 01/10] drm/i915: Only attempt to scan the requested number of shrinker slabs Chris Wilson
2018-01-17 10:29   ` Tvrtko Ursulin
2018-01-18  9:16     ` Chris Wilson
2018-01-18  9:19     ` Chris Wilson
2018-01-15 21:24 ` [PATCH 02/10] drm/i915: Move i915_gem_retire_work_handler Chris Wilson
2018-01-17 10:33   ` Tvrtko Ursulin
2018-01-15 21:24 ` [PATCH 03/10] drm/i915: Shrink the GEM kmem_caches upon idling Chris Wilson
2018-01-16 10:00   ` Tvrtko Ursulin
2018-01-16 10:19     ` Chris Wilson
2018-01-16 13:05     ` [PATCH v2] " Chris Wilson
2018-01-16 15:12       ` Tvrtko Ursulin
2018-01-16 15:16         ` Tvrtko Ursulin
2018-01-16 15:21         ` Chris Wilson
2018-01-16 17:25           ` Tvrtko Ursulin
2018-01-16 17:36             ` Chris Wilson
2018-01-17 10:18               ` Tvrtko Ursulin
2018-01-18 18:06                 ` Chris Wilson
2018-01-15 21:24 ` [PATCH 04/10] drm/i915: Shrink the request kmem_cache on allocation error Chris Wilson
2018-01-16 10:10   ` Tvrtko Ursulin
2018-01-16 10:26     ` Chris Wilson
2018-01-16 13:15     ` [PATCH v2] " Chris Wilson
2018-01-16 15:19       ` Tvrtko Ursulin
2018-01-15 21:24 ` [PATCH 05/10] drm/i915: Trim the retired request queue after submitting Chris Wilson
2018-01-16 10:18   ` Tvrtko Ursulin
2018-01-16 10:32     ` Chris Wilson
2018-01-17 10:23       ` Tvrtko Ursulin
2018-01-16 13:30     ` [PATCH v2] " Chris Wilson
2018-01-15 21:24 ` [PATCH 06/10] drm/i915/breadcrumbs: Drop request reference for the signaler thread Chris Wilson
2018-01-15 21:24 ` [PATCH 07/10] drm/i915: Reduce spinlock hold time during notify_ring() interrupt Chris Wilson
2018-01-17 10:45   ` Tvrtko Ursulin
2018-01-18 18:08     ` Chris Wilson
2018-01-18 18:10     ` Chris Wilson
2018-01-15 21:24 ` [PATCH 08/10] drm/i915: Move the irq_counter inside the spinlock Chris Wilson
2018-01-17 12:12   ` Tvrtko Ursulin
2018-01-15 21:24 ` [PATCH 09/10] drm/i915: Only signal from interrupt when requested Chris Wilson
2018-01-17 12:22   ` Tvrtko Ursulin [this message]
2018-01-18 18:12     ` Chris Wilson
2018-01-15 21:24 ` [PATCH 10/10] drm/i915/breadcrumbs: Reduce signaler rbtree to a sorted list Chris Wilson
2018-01-15 22:04 ` ✓ Fi.CI.BAT: success for series starting with [01/10] drm/i915: Only attempt to scan the requested number of shrinker slabs Patchwork
2018-01-16  9:21 ` ✓ Fi.CI.IGT: " Patchwork
2018-01-16  9:52 ` Prevent trivial oom from gem_exec_nop/sequential Tvrtko Ursulin
2018-01-16 10:02   ` Chris Wilson
2018-01-16 13:10   ` Chris Wilson
2018-01-16 13:42 ` ✓ Fi.CI.BAT: success for series starting with [01/10] drm/i915: Only attempt to scan the requested number of shrinker slabs (rev3) Patchwork
2018-01-16 14:02 ` ✓ Fi.CI.BAT: success for series starting with [01/10] drm/i915: Only attempt to scan the requested number of shrinker slabs (rev4) Patchwork
2018-01-16 15:29 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2894bed-9e67-df0e-cded-ba0d1633caf6@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox