All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: benjamin.widawsky@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: drm/i915: Initialize all contexts
Date: Mon, 23 Mar 2015 18:54:52 +0300	[thread overview]
Message-ID: <20150323155452.GB24038@mwanda> (raw)

Hello Ben Widawsky,

This is a semi-automatic email about new static checker warnings.

The patch 6702cf16e0ba: "drm/i915: Initialize all contexts" from Mar 
16, 2015, leads to the following Smatch complaint:

drivers/gpu/drm/i915/i915_gem_context.c:730 do_switch()
	 error: we previously assumed 'to->ppgtt' could be null (see line 713)

drivers/gpu/drm/i915/i915_gem_context.c
   712			 * occur when this occurs. */
   713		} else if (to->ppgtt &&
                           ^^^^^^^^^
Patch introduces a new NULL check.

   714				test_and_clear_bit(ring->id, &to->ppgtt->pd_dirty_rings))
   715			hw_flags |= MI_FORCE_RESTORE;
   716	
   717		/* We should never emit switch_mm more than once */
   718		WARN_ON(needs_pd_load_pre(ring, to) &&
   719				needs_pd_load_post(ring, to, hw_flags));
   720	
   721		ret = mi_set_context(ring, to, hw_flags);
   722		if (ret)
   723			goto unpin_out;
   724	
   725		/* GEN8 does *not* require an explicit reload if the PDPs have been
   726		 * setup, and we do not wish to move them.
   727		 */
   728		if (needs_pd_load_post(ring, to, hw_flags)) {
   729			trace_switch_mm(ring, to);
   730			ret = to->ppgtt->switch_mm(to->ppgtt, ring);
                              ^^^^^^^^^^^
Existing unchecked dereference.

   731			/* The hardware context switch is emitted, but we haven't
   732			 * actually changed the state - so it's probably safe to bail

regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-03-23 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 15:54 Dan Carpenter [this message]
2015-03-24  9:12 ` drm/i915: Initialize all contexts Daniel Vetter
2015-03-24 10:09   ` Mika Kuoppala
2015-03-24 10:57     ` Dan Carpenter

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=20150323155452.GB24038@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=benjamin.widawsky@intel.com \
    --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 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.