[Intel-gfx] [PATCH] drm/i915: Disable mmio debugging during user access
Chris Wilson
chris at chris-wilson.co.uk
Thu Sep 7 13:31:51 UTC 2017
Quoting Mika Kuoppala (2017-09-07 14:22:21)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
>
> > If the user bypasses i915 and accesses mmio directly, that easily
> > confuses our automatic mmio debugging (any error we then detect is
> > likely to be as a result of the user). Since we expect userspace to open
> > debugfs/i915_forcewake_user if i915.ko is loaded and they want mmio
> > access, that makes the opportune time to disable our debugging for
> > duration of the bypass.
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=102543
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_debugfs.c | 32 ++++++++++++++++++++++++++++++--
> > drivers/gpu/drm/i915/intel_uncore.h | 7 +++++++
> > 2 files changed, 37 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 48572b157222..d63b3c5c2f83 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -4679,7 +4679,21 @@ static int i915_forcewake_open(struct inode *inode, struct file *file)
> > return 0;
> >
> > intel_runtime_pm_get(dev_priv);
> > - intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
> > +
> > + spin_lock_irq(&dev_priv->uncore.lock);
> > + if (!dev_priv->uncore.user_forcewake.count++) {
> > + intel_uncore_forcewake_get__locked(dev_priv, FORCEWAKE_ALL);
> > +
> > + /* Save and disable mmio debugging for the user bypass */
> > + dev_priv->uncore.user_forcewake.saved_mmio_check =
> > + dev_priv->uncore.unclaimed_mmio_check;
> > + dev_priv->uncore.user_forcewake.saved_mmio_debug =
> > + i915.mmio_debug;
> > +
> > + dev_priv->uncore.unclaimed_mmio_check = 0;
> > + i915.mmio_debug = 0;
> > + }
> > + spin_unlock_irq(&dev_priv->uncore.lock);
>
> Just pondering if this should be in intel_uncore.c as a
> user_mmio_bypass_on/off(). But not insisting.
Good call. Fwiw, since CI didn't report the improvement, this did shut up
tools_tests:
[ 37.601863] i915 0000:00:02.0: Unclaimed mmio occurred during user acess
Ah better fix the spelling as well.
-Chris
More information about the Intel-gfx
mailing list