public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 4/7] drm/i915: Remove irq-related FIXME in reset code
Date: Mon, 2 Mar 2015 16:23:55 +0100	[thread overview]
Message-ID: <20150302152355.GZ24485@phenom.ffwll.local> (raw)
In-Reply-To: <CABVU7+sHOYi8Onwz9j3bkFQf57a0V+Bq2qtjGPrVUvWLBpL=kQ@mail.gmail.com>

On Fri, Feb 27, 2015 at 01:54:02PM -0800, Rodrigo Vivi wrote:
> cool, thanks for the detailed explanation.
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Queued for -next, thanks for the patch.
-Daniel

> 
> On Fri, Feb 27, 2015 at 6:04 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Thu, Feb 26, 2015 at 05:11:16PM -0800, Rodrigo Vivi wrote:
> >> I believe this patch is on the wrong series, right?
> >
> > It's in here since I've spotted the FIXME while removing ums crap.
> >
> >> I'm afraid I don't know what was this race neither the two-step reset
> >> to be able to review this comment remove.
> >> Please give me some pointers to check that.
> >
> > Let me explain the history a bit. git blame on the various parts and this
> > fixme should be able to dig out the details (it's a fun story):
> >
> > Originally we've had an unconditional drm_irq_install/unistall in the
> > reset code. Which is not cool since it meant we'd kill all the interrutps
> > that have been going on, so pageflips, vblank waits, crc checksums, gem
> > waits all stopped working. This is the bug the FIXME is about.
> >
> > With fixed most of these issues by no longer disabling/enabling interrupts
> > driver-wide, but only restoring the interrupt bits on the gt (they get
> > lost in the reset). That takes care of all the modeset interrupts.
> >
> > The gem waits have been fixed differently and much earlier with the
> > 2-stage reset code:
> >
> > - before reset we set a flag RESET_IN_PROGRESS and wake up all waiters.
> >
> > - after reset we clear that flag by incrementing the reset counter and
> >   again wake all waiters
> >
> > Waiters always check this flag and the reset counter every time they are
> > woken and bail out with -EINTR (to restart the entire ioctl) if that's the
> > case. That means they'll never miss a reset and so won't be affected by
> > interrupts suddenly being cleared.
> >
> > I've simply forgotten to remove the FIXME ;-)
> >
> > Cheers, Daniel
> >>
> >>
> >> On Mon, Feb 23, 2015 at 3:03 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >> > With the two-step reset counter increments which braket the actual
> >> > reset code and the subsequent wake-up we're guaranteeing that all the
> >> > lockless waiters _will_ be woken up. And since we unconditionally bail
> >> > out of waits with -EAGAIN (or -EIO) in that case there is not risk of
> >> > lost interrupt enabling bits when the lockless wait code races against
> >> > a gpu reset.
> >> >
> >> > Let's remove this FIXME as resolved then.
> >> >
> >> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/i915_drv.c | 6 ------
> >> >  1 file changed, 6 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> >> > index cc6c51107047..89741e6e2d08 100644
> >> > --- a/drivers/gpu/drm/i915/i915_drv.c
> >> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> >> > @@ -878,12 +878,6 @@ int i915_reset(struct drm_device *dev)
> >> >         }
> >> >
> >> >         /*
> >> > -        * FIXME: This races pretty badly against concurrent holders of
> >> > -        * ring interrupts. This is possible since we've started to drop
> >> > -        * dev->struct_mutex in select places when waiting for the gpu.
> >> > -        */
> >> > -
> >> > -       /*
> >> >          * rps/rc6 re-init is necessary to restore state lost after the
> >> >          * reset and the re-install of gt irqs. Skip for ironlake per
> >> >          * previous concerns that it doesn't respond well to some forms
> >> > --
> >> > 2.1.4
> >> >
> >> > _______________________________________________
> >> > Intel-gfx mailing list
> >> > Intel-gfx@lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >>
> >>
> >>
> >> --
> >> Rodrigo Vivi
> >> Blog: http://blog.vivi.eng.br
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-02 15:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 11:03 [PATCH 1/7] drm/i915: Remove DRIVER_MODESET checks in load/unload/close code Daniel Vetter
2015-02-23 11:03 ` [PATCH 2/7] drm/i915: Remove DRIVER_MODESET checks from suspend/resume code Daniel Vetter
2015-02-27  1:06   ` Rodrigo Vivi
2015-02-23 11:03 ` [PATCH 3/7] drm/i915: Remove DRIVER_MODESET checks in the gpu reset code Daniel Vetter
2015-02-27  1:06   ` Rodrigo Vivi
2015-02-23 11:03 ` [PATCH 4/7] drm/i915: Remove irq-related FIXME in " Daniel Vetter
2015-02-27  1:11   ` Rodrigo Vivi
2015-02-27 14:04     ` Daniel Vetter
2015-02-27 21:54       ` Rodrigo Vivi
2015-03-02 15:23         ` Daniel Vetter [this message]
2015-02-23 11:03 ` [PATCH 5/7] drm/i915: Remove DRIVER_MODESET checks from gem code Daniel Vetter
2015-02-27  1:12   ` Rodrigo Vivi
2015-02-23 11:03 ` [PATCH 6/7] drm/i915: Remove regfile code&data for UMS suspend/resume Daniel Vetter
2015-02-27  1:16   ` Rodrigo Vivi
2015-02-23 11:03 ` [PATCH 7/7] drm/i915: Remove DRIVER_MODESET checks from modeset code Daniel Vetter
2015-02-23 17:13   ` shuang.he
2015-02-27  1:17   ` Rodrigo Vivi
2015-02-27 14:07     ` Daniel Vetter
2015-02-27  1:06 ` [PATCH 1/7] drm/i915: Remove DRIVER_MODESET checks in load/unload/close code Rodrigo Vivi

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=20150302152355.GZ24485@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox