Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Dave Airlie <airlied@redhat.com>, Woodhouse <dwmw2@infradead.org>,
	intel-gfx@lists.freedesktop.org, David@freedesktop.org
Subject: Re: [PATCH] drm/i915: Ironlake GPU with VT-d fix
Date: Fri, 23 Sep 2011 20:03:18 +0100	[thread overview]
Message-ID: <c55c5d$j43q4@AZSMGA002.ch.intel.com> (raw)
In-Reply-To: <20110923083849.7bff0502@bwidawsk.net>

On Fri, 23 Sep 2011 08:38:49 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Fri, 23 Sep 2011 08:37:10 +0100
> Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > On Thu, 22 Sep 2011 22:09:39 -0700, Ben Widawsky <ben@bwidawsk.net>
> > wrote:
> > > On Thu, 22 Sep 2011 21:50:49 -0700
> > > Keith Packard <keithp@keithp.com> wrote:
> > > 
> > > > On Thu, 22 Sep 2011 17:11:52 -0700, Ben Widawsky
> > > > <ben@bwidawsk.net> wrote:
> > > > 
> > > > > It requires an additional IOMMU patch.
> > > > 
> > > > Can we collect those two patches into one sequence?
> > > > 
> > > 
> > > Yes. Although not sure who would do the pull request to Linus.
> > > 
> > > > > +	if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB ||
> > > > > +	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
> > > > > +	     intel_private.base.needs_dmar)
> > > > > +		intel_private.base.do_idle_maps = 1;
> > > > > +
> > > > 
> > > > I'd like to make this conditional on whether IOMMU is actually in
> > > > use; needs_dmar is based solely on whether the DMA_API is
> > > > compiled into the kernel and the GTT gen is > 2.
> > > 
> > > David did mention a way for me to detect it. I wasn't sure if there
> > > was a deadline to get this patch out so I submitted it now. I will
> > > work on the detection portion of it while the rest gets review.
> > > It's something like, check if the bus address == the physical
> > > address and if not, assume the IOMMU is in use.
> > 
> > And for starters, we can check no_iommu. But really we want
> > intel_iommu.c to report whether or not it enabled VTd on the gfx.
> >  
> > > > 
> > > > > -	if (lists_empty)
> > > > > +	if (lists_empty && !!dev_priv->mm.gtt->do_idle_maps)
> > > > >  		return 0;
> > > > 
> > > > Is it necessary to change the semantic of this function in cases
> > > > which aren't related to GTT remapping? Seems like you're imposing
> > > > a fairly high cost on operations which don't actually need it.
> > > > 
> > > 
> > > Not sure I follow. On that specific hunk it's apparently needed. I
> > > tried the patch without this and we got some data back which
> > > suggested it didn't work. It would be nice if we could reproduce
> > > this locally...
> > 
> > Keith is right, there should be no reason to touch that function,
> > and especially not for the normal code paths.
> 
> Crap... This is a bug in the patch.

I'm still can't explain the necessity of forcing the i915_ring_idle()
here. If those two lists are empty, then each of the ring write/active
lists should also be empty and it will be a no-op. Hence bafflement and
time to be slightly afraid.

> > 
> > Also we should not introduce BUG_ON() trivially into user code paths
> > (/dev/agp).
> 
> Remove 'em then?

Not quite, in this case I think returning -ENODEV is the sensible
approach.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

      reply	other threads:[~2011-09-23 19:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23  0:11 [PATCH] drm/i915: Ironlake GPU with VT-d fix Ben Widawsky
2011-09-23  4:50 ` Keith Packard
2011-09-23  5:09   ` Ben Widawsky
2011-09-23  7:37     ` Chris Wilson
2011-09-23 15:38       ` Ben Widawsky
2011-09-23 19:03         ` Chris Wilson [this message]

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='c55c5d$j43q4@AZSMGA002.ch.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=David@freedesktop.org \
    --cc=airlied@redhat.com \
    --cc=ben@bwidawsk.net \
    --cc=dwmw2@infradead.org \
    --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