All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915/psr: Fix race in intel_psr_work()
Date: Mon, 25 Jun 2018 11:04:20 -0700	[thread overview]
Message-ID: <1529949860.22930.2.camel@intel.com> (raw)
In-Reply-To: <152983048567.29811.13445243124127287389@mail.alporthouse.com>

On Sun, 2018-06-24 at 09:54 +0100, Chris Wilson wrote:
> Quoting Dhinakaran Pandiyan (2018-06-23 05:45:06)
> > 
> > commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
> > back.") switched from delayed work to the plain variant and while
> > doing so
> > remove the check for work_busy() before scheduling a PSR
> > activation.
> > This appears to cause consecutive executions of psr_activate() in
> > this
> > scenario - after a worker picks up the PSR work item for execution
> > and
> > before the work function can acquire the PSR mutex, a psr_flush()
> > can
> > get hold of the mutex and schedule another PSR work. Without a
> > psr_exit()
> > between two psr_activate() calls, the warning messages get printed.
> Ok, that would explain the second work.
> 
> > 
> > Further, since we drop the mutex in the midst of psr_work() to wait
> > for
> > PSR to idle, another work item can also get scheduled. Fix this by
> > returning if PSR was already active.
> > 
> > Note:
> > I am not 100% sure this is what is going on as I could not
> > reproduce
> > the bug (https://bugs.freedesktop.org/show_bug.cgi?id=106948)
> > 
> > This patch sort of defeats the point of the WARN_ON()s in
> > psr_activate()
> > now, do we still need them?
> WARN_ON(active), yup. Seems reasonable to keep for the moment.
> WARN_ON(hw_state) would be worth keeping for some time. Hmm,
> shouldn't
> it be checking both PSR_CTL irrespective of intended mode. After
> switching psr1 to psr2 we should check that psr1 is disabled as well,
> and vice versa.
> 
Yeah, I've sent a patch to check both PSR_CTL and PSR2_CTL. Thanks for
the review.

-DK

> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2018-06-25 17:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23  4:45 [PATCH] drm/i915/psr: Fix race in intel_psr_work() Dhinakaran Pandiyan
2018-06-23  5:14 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-06-23  6:05 ` ✓ Fi.CI.IGT: " Patchwork
2018-06-24  8:54 ` [PATCH] " Chris Wilson
2018-06-25 18:04   ` Dhinakaran Pandiyan [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=1529949860.22930.2.camel@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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.