All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Peter Antoine <peter.antoine@intel.com>, stable@vger.kernel.org
Cc: daniel@ffwll.ch, Peter Antoine <peter.antoine@intel.com>
Subject: Re: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
Date: Tue, 23 Jun 2015 10:12:36 +0300	[thread overview]
Message-ID: <87k2uu290b.fsf@intel.com> (raw)
In-Reply-To: <1434994003-31366-1-git-send-email-peter.antoine@intel.com>

On Mon, 22 Jun 2015, Peter Antoine <peter.antoine@intel.com> wrote:
> This patch fixes a timing issue that causes a GPU hang when the system
> comes out of power saving.
>
> During pm_resume, We are submitting batchbuffers before enabling
> Interrupts this is causing us to miss the context switch interrupt,
> and in consequence intel_execlists_handle_ctx_events is not triggered.
>
> This patch is based on a patch from Deepak S <deepak.s@intel.com>
> from another platform.
>
> The patch fixes an issue introduced by:
>   commit e7778be1eab918274f79603d7c17b3ec8be77386
>   drm/i915: Fix startup failure in LRC mode after recent init changes
>
> The above patch added a call to init_context() to fix an issue introduced
> by a previous patch. But, it then opened up a small timing window for the
> batches being added by the init_context (basically setting up the context)
> to complete before the interrupts have been turned on, thus hanging the
> GPU.
>
> [backport of 4.1 commit 364aece01a2dd748fc36a1e8bf52ef639b0857bd]
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89600
> Cc: stable@vger.kernel.org # 4.0+
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> [Jani: fixed typo in subject, massaged the comments a bit]
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Acked-by: Jani Nikula <jani.nikula@intel.com>

...although based on the patch context I'm not sure why this needs a
separate backport. Does it not cherry-pick cleanly to 4.0? The stable
team should take care of these automatically.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index ec4d932..169123a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -693,6 +693,16 @@ static int i915_drm_resume(struct drm_device *dev)
>  		intel_init_pch_refclk(dev);
>  		drm_mode_config_reset(dev);
>  
> +		/*
> +		 * Interrupts have to be enabled before any batches are run.
> +		 * If not the GPU will hang. i915_gem_init_hw() will initiate
> +		 * batches to update/restore the context.
> +		 *
> +		 * Modeset enabling in intel_modeset_init_hw() also needs
> +		 * working interrupts.
> +		 */
> +		intel_runtime_pm_enable_interrupts(dev_priv);
> +
>  		mutex_lock(&dev->struct_mutex);
>  		if (i915_gem_init_hw(dev)) {
>  			DRM_ERROR("failed to re-initialize GPU, declaring wedged!\n");
> @@ -700,9 +710,6 @@ static int i915_drm_resume(struct drm_device *dev)
>  		}
>  		mutex_unlock(&dev->struct_mutex);
>  
> -		/* We need working interrupts for modeset enabling ... */
> -		intel_runtime_pm_enable_interrupts(dev_priv);
> -
>  		intel_modeset_init_hw(dev);
>  
>  		spin_lock_irq(&dev_priv->irq_lock);
> -- 
> 1.9.1
>

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe stable" in

  reply	other threads:[~2015-06-23  7:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 17:26 [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4 Peter Antoine
2015-06-23  7:12 ` Jani Nikula [this message]
2015-06-23  7:12   ` Antoine, Peter
2015-06-23 11:33   ` Daniel Vetter
2015-06-23 11:35     ` Antoine, Peter
  -- strict thread matches above, loose matches on Subject: below --
2015-04-27 14:30 [PATCH] drm/i915: Avoid GPU hang when coming out of P3 or P4 Peter Antoine
2015-04-27 14:30 ` [PATCH] drm/i915: Avoid GPU hang when coming out of S3 or S4 Peter Antoine
2015-04-28  9:29   ` shuang.he

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=87k2uu290b.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=peter.antoine@intel.com \
    --cc=stable@vger.kernel.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 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.