* [PATCH v4] drm/i915: Avoid GPU Hang when comming out of s3 or s4
[not found] <20150511103303.GZ15256@phenom.ffwll.local>
@ 2015-05-11 11:05 ` Peter Antoine
2015-05-11 12:22 ` Greg KH
2015-05-11 12:35 ` [PATCH v5] " Peter Antoine
1 sibling, 1 reply; 4+ messages in thread
From: Peter Antoine @ 2015-05-11 11:05 UTC (permalink / raw)
To: intel-gfx
Cc: david.weinehall, yex.tian, deepak.s, thomas.daniel, daniel.vetter,
stable, Peter Antoine
This patch fixed a timing issue that causes a GPU hang when a 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
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6bb6c47..748ab13 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -734,6 +734,13 @@ 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. The init_hw will initiate batches to update/restore
+ * the context.
+ */
+ 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");
@@ -741,9 +748,7 @@ 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);
-
+ /* This must follow the pm enable interrupts */
intel_modeset_init_hw(dev);
spin_lock_irq(&dev_priv->irq_lock);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4] drm/i915: Avoid GPU Hang when comming out of s3 or s4
2015-05-11 11:05 ` [PATCH v4] drm/i915: Avoid GPU Hang when comming out of s3 or s4 Peter Antoine
@ 2015-05-11 12:22 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-05-11 12:22 UTC (permalink / raw)
To: Peter Antoine
Cc: intel-gfx, david.weinehall, yex.tian, deepak.s, thomas.daniel,
daniel.vetter, stable
On Mon, May 11, 2015 at 12:05:27PM +0100, Peter Antoine wrote:
> This patch fixed a timing issue that causes a GPU hang when a 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
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read Documentation/stable_kernel_rules.txt
for how to do this properly.
</formletter>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v5] drm/i915: Avoid GPU Hang when comming out of s3 or s4
[not found] <20150511103303.GZ15256@phenom.ffwll.local>
2015-05-11 11:05 ` [PATCH v4] drm/i915: Avoid GPU Hang when comming out of s3 or s4 Peter Antoine
@ 2015-05-11 12:35 ` Peter Antoine
2015-05-12 8:34 ` [Intel-gfx] " Jani Nikula
1 sibling, 1 reply; 4+ messages in thread
From: Peter Antoine @ 2015-05-11 12:35 UTC (permalink / raw)
To: intel-gfx
Cc: david.weinehall, yex.tian, deepak.s, thomas.daniel, daniel.vetter,
Peter Antoine, stable
This patch fixed a timing issue that causes a GPU hang when a 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
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6bb6c47..748ab13 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -734,6 +734,13 @@ 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. The init_hw will initiate batches to update/restore
+ * the context.
+ */
+ 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");
@@ -741,9 +748,7 @@ 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);
-
+ /* This must follow the pm enable interrupts */
intel_modeset_init_hw(dev);
spin_lock_irq(&dev_priv->irq_lock);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH v5] drm/i915: Avoid GPU Hang when comming out of s3 or s4
2015-05-11 12:35 ` [PATCH v5] " Peter Antoine
@ 2015-05-12 8:34 ` Jani Nikula
0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2015-05-12 8:34 UTC (permalink / raw)
To: Peter Antoine, intel-gfx
Cc: daniel.vetter, david.weinehall, stable, yex.tian, deepak.s
On Mon, 11 May 2015, Peter Antoine <peter.antoine@intel.com> wrote:
> This patch fixed a timing issue that causes a GPU hang when a 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
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
I pushed some version of this patch to drm-intel-fixes yesterday, with
some comment modifications. Thanks for the patch and review.
For future reference, please add some changelog to your patches so it's
easier to know what's changed between versions.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/i915_drv.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 6bb6c47..748ab13 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -734,6 +734,13 @@ 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. The init_hw will initiate batches to update/restore
> + * the context.
> + */
> + 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");
> @@ -741,9 +748,7 @@ 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);
> -
> + /* This must follow the pm enable interrupts */
> intel_modeset_init_hw(dev);
>
> spin_lock_irq(&dev_priv->irq_lock);
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-12 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20150511103303.GZ15256@phenom.ffwll.local>
2015-05-11 11:05 ` [PATCH v4] drm/i915: Avoid GPU Hang when comming out of s3 or s4 Peter Antoine
2015-05-11 12:22 ` Greg KH
2015-05-11 12:35 ` [PATCH v5] " Peter Antoine
2015-05-12 8:34 ` [Intel-gfx] " Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).