All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>, intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH] drm/i915: flush delayed_resume_work when	suspending
Date: Tue, 01 Jul 2014 17:49:05 +0300	[thread overview]
Message-ID: <87y4wdf82m.fsf@intel.com> (raw)
In-Reply-To: <1403905911-3859-1-git-send-email-przanoni@gmail.com>

On Sat, 28 Jun 2014, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> It is possible that, by the time we run i915_drm_freeze(),
> delayed_resume_work was already queued but did not run yet. If it
> still didn't run after intel_runtime_pm_disable_interrupts(), by the
> time it runs it will try to change the interrupt registers with the
> interrupts already disabled, which will trigger a WARN. We can
> reliably reproduce this with the pm_rpm system-suspend test case.
>
> In order to avoid the problem, we have to flush the work before
> disabling the interrupts. We could also cancel the work instead of
> flushing it, but that would require us to put a runtime PM reference -
> and any other resource we may need in the future - in case the work
> was already queued, so I believe flushing the work is more
> future-proof, although less efficient. But I can also change this part
> if someone requests.
>
> Another thing I tried was to move the intel_suspend_gt_powersave()
> call to before intel_runtime_pm_disable_interrupts(), but since that
> function needs to be called after the interrupts are already disabled,
> due to dev_priv->rps.work, this strategy didn't work.
>
> Testcase: igt/pm_rpm/system-suspend
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80517
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

Pushed to dinq, thanks for the patch and review.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index e64547e..672694b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -524,6 +524,8 @@ static int i915_drm_freeze(struct drm_device *dev)
>  			return error;
>  		}
>  
> +		flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> +
>  		intel_runtime_pm_disable_interrupts(dev);
>  		dev_priv->enable_hotplug_processing = false;
>  
> -- 
> 2.0.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center

      parent reply	other threads:[~2014-07-01 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 21:51 [PATCH] drm/i915: flush delayed_resume_work when suspending Paulo Zanoni
2014-06-27 22:30 ` Rodrigo Vivi
2014-06-30 19:22   ` Paulo Zanoni
2014-06-30 19:54     ` [PATCH] drm/i915: cancel " Paulo Zanoni
2014-06-30 20:10     ` [PATCH] drm/i915: flush " Rodrigo Vivi
2014-07-01 14:49 ` Jani Nikula [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=87y4wdf82m.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=przanoni@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 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.