All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Harrison <john.c.harrison@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	<matthew.brost@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [bug report] drm/i915: Move submission tasklet to i915_sched_engine
Date: Fri, 6 Oct 2023 11:50:16 -0700	[thread overview]
Message-ID: <48253c7a-09ef-d778-c036-9f75283d9751@intel.com> (raw)
In-Reply-To: <c31cab01-344b-4117-b14f-1191c611358f@moroto.mountain>

Tvrtko, would you have any thoughts on this one?

John.


On 10/4/2023 02:57, Dan Carpenter wrote:
> Hello Matthew Brost,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 22916bad07a5: "drm/i915: Move submission tasklet to
> i915_sched_engine" from Jun 17, 2021, leads to the following Smatch
> complaint:
>
>      drivers/gpu/drm/i915/gt/intel_execlists_submission.c:3659 rcu_virtual_context_destroy()
>      warn: variable dereferenced before check 've->base.sched_engine' (see line 3633)
>
> drivers/gpu/drm/i915/gt/intel_execlists_submission.c
>    3632		 */
>    3633		tasklet_kill(&ve->base.sched_engine->tasklet);
>                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The patch introduced a new dereference here
>
>    3634	
>    3635		/* Decouple ourselves from the siblings, no more access allowed. */
>    3636		for (n = 0; n < ve->num_siblings; n++) {
>    3637			struct intel_engine_cs *sibling = ve->siblings[n];
>    3638			struct rb_node *node = &ve->nodes[sibling->id].rb;
>    3639	
>    3640			if (RB_EMPTY_NODE(node))
>    3641				continue;
>    3642	
>    3643			spin_lock_irq(&sibling->sched_engine->lock);
>    3644	
>    3645			/* Detachment is lazily performed in the sched_engine->tasklet */
>    3646			if (!RB_EMPTY_NODE(node))
>    3647				rb_erase_cached(node, &sibling->execlists.virtual);
>    3648	
>    3649			spin_unlock_irq(&sibling->sched_engine->lock);
>    3650		}
>    3651		GEM_BUG_ON(__tasklet_is_scheduled(&ve->base.sched_engine->tasklet));
>    3652		GEM_BUG_ON(!list_empty(virtual_queue(ve)));
>    3653	
>    3654		lrc_fini(&ve->context);
>    3655		intel_context_fini(&ve->context);
>    3656	
>    3657		if (ve->base.breadcrumbs)
>    3658			intel_breadcrumbs_put(ve->base.breadcrumbs);
>    3659		if (ve->base.sched_engine)
>                      ^^^^^^^^^^^^^^^^^^^^^
> But previous code had assumed the sched_engine could be NULL.
>
>    3660			i915_sched_engine_put(ve->base.sched_engine);
>    3661		intel_engine_free_request_pool(&ve->base);
>
> regards,
> dan carpenter


  reply	other threads:[~2023-10-06 18:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  9:57 [Intel-gfx] [bug report] drm/i915: Move submission tasklet to i915_sched_engine Dan Carpenter
2023-10-06 18:50 ` John Harrison [this message]
2023-10-09  8:30   ` Tvrtko Ursulin

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=48253c7a-09ef-d778-c036-9f75283d9751@intel.com \
    --to=john.c.harrison@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.