All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4" failed to apply to 4.0-stable tree
@ 2015-06-03  5:34 gregkh
  2015-06-03  6:38   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2015-06-03  5:34 UTC (permalink / raw)
  To: peter.antoine, daniel.vetter, deepak.s, jani.nikula; +Cc: stable


The patch below does not apply to the 4.0-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 364aece01a2dd748fc36a1e8bf52ef639b0857bd Mon Sep 17 00:00:00 2001
From: Peter Antoine <peter.antoine@intel.com>
Date: Mon, 11 May 2015 08:50:45 +0100
Subject: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4

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.

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>

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c302ffb5a168..a19d2c71e205 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -699,6 +699,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");
@@ -706,9 +716,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);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4" failed to apply to 4.0-stable tree
  2015-06-03  5:34 FAILED: patch "[PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4" failed to apply to 4.0-stable tree gregkh
@ 2015-06-03  6:38   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2015-06-03  6:38 UTC (permalink / raw)
  To: gregkh, peter.antoine, daniel.vetter, deepak.s,
	intel-gfx@lists.freedesktop.org
  Cc: stable


+intel-gfx, anyone up for a backport?

BR,
Jani.

On Wed, 03 Jun 2015, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 4.0-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 364aece01a2dd748fc36a1e8bf52ef639b0857bd Mon Sep 17 00:00:00 2001
> From: Peter Antoine <peter.antoine@intel.com>
> Date: Mon, 11 May 2015 08:50:45 +0100
> Subject: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
>
> 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.
>
> 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>
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index c302ffb5a168..a19d2c71e205 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -699,6 +699,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");
> @@ -706,9 +716,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);
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4" failed to apply to 4.0-stable tree
@ 2015-06-03  6:38   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2015-06-03  6:38 UTC (permalink / raw)
  To: gregkh, peter.antoine, daniel.vetter, deepak.s,
	intel-gfx@lists.freedesktop.org
  Cc: stable


+intel-gfx, anyone up for a backport?

BR,
Jani.

On Wed, 03 Jun 2015, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 4.0-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 364aece01a2dd748fc36a1e8bf52ef639b0857bd Mon Sep 17 00:00:00 2001
> From: Peter Antoine <peter.antoine@intel.com>
> Date: Mon, 11 May 2015 08:50:45 +0100
> Subject: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
>
> 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.
>
> 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>
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index c302ffb5a168..a19d2c71e205 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -699,6 +699,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");
> @@ -706,9 +716,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);
>

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-03  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03  5:34 FAILED: patch "[PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4" failed to apply to 4.0-stable tree gregkh
2015-06-03  6:38 ` Jani Nikula
2015-06-03  6:38   ` Jani Nikula

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.