* [PATCH] drm/i915: Avoid GPU hang when coming out of S3 or S4
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 ` Peter Antoine
2015-04-28 9:29 ` shuang.he
0 siblings, 1 reply; 7+ messages in thread
From: Peter Antoine @ 2015-04-27 14:30 UTC (permalink / raw
To: intel-gfx; +Cc: deepak.s, yex.tian, david.weinehall
This patch fixed a timing issue that causes a GPU hang when a the system
comes out of power saving.
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 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e70adfd..648866f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -712,6 +712,11 @@ static int i915_drm_resume(struct drm_device *dev)
intel_init_pch_refclk(dev);
drm_mode_config_reset(dev);
+ /* We need working interrupts for modeset enabling ... */
+ intel_runtime_pm_enable_interrupts(dev_priv);
+
+ intel_modeset_init_hw(dev);
+
mutex_lock(&dev->struct_mutex);
if (i915_gem_init_hw(dev)) {
DRM_ERROR("failed to re-initialize GPU, declaring wedged!\n");
@@ -719,11 +724,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);
if (dev_priv->display.hpd_irq_setup)
dev_priv->display.hpd_irq_setup(dev);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915: Avoid GPU hang when coming out of S3 or S4
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
0 siblings, 0 replies; 7+ messages in thread
From: shuang.he @ 2015-04-28 9:29 UTC (permalink / raw
To: shuang.he, ethan.gao, intel-gfx, peter.antoine
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6271
-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 276/276 276/276
ILK -1 302/302 301/302
SNB 318/318 318/318
IVB 341/341 341/341
BYT 287/287 287/287
BDW 318/318 318/318
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*ILK igt@gem_fenced_exec_thrash@no-spare-fences-busy PASS(4) DMESG_WARN(1)PASS(1)
(dmesg patch applied)drm:i915_hangcheck_elapsed[i915]]*ERROR*Hangcheck_timer_elapsed...bsd_ring_idle@Hangcheck timer elapsed... bsd ring idle
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
@ 2015-06-22 17:26 Peter Antoine
2015-06-23 7:12 ` Jani Nikula
0 siblings, 1 reply; 7+ messages in thread
From: Peter Antoine @ 2015-06-22 17:26 UTC (permalink / raw
To: stable; +Cc: daniel, Peter Antoine, Jani Nikula
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>
---
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
--
To unsubscribe from this list: send the line "unsubscribe stable" in
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
2015-06-23 7:12 ` Jani Nikula
@ 2015-06-23 7:12 ` Antoine, Peter
2015-06-23 11:33 ` Daniel Vetter
1 sibling, 0 replies; 7+ messages in thread
From: Antoine, Peter @ 2015-06-23 7:12 UTC (permalink / raw
To: Nikula, Jani, stable@vger.kernel.org; +Cc: daniel@ffwll.ch
Hi Jani,
I was told it needs doing by Daniel.
Peter.
-----Original Message-----
From: Nikula, Jani
Sent: Tuesday, June 23, 2015 8:13 AM
To: Antoine, Peter; stable@vger.kernel.org
Cc: daniel@ffwll.ch; Antoine, Peter
Subject: Re: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
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
2015-06-23 7:12 ` Antoine, Peter
2015-06-23 11:33 ` Daniel Vetter
0 siblings, 2 replies; 7+ messages in thread
From: Jani Nikula @ 2015-06-23 7:12 UTC (permalink / raw
To: Peter Antoine, stable; +Cc: daniel, Peter Antoine
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
2015-06-23 7:12 ` Jani Nikula
2015-06-23 7:12 ` Antoine, Peter
@ 2015-06-23 11:33 ` Daniel Vetter
2015-06-23 11:35 ` Antoine, Peter
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2015-06-23 11:33 UTC (permalink / raw
To: Jani Nikula; +Cc: Peter Antoine, stable
On Tue, Jun 23, 2015 at 9:12 AM, Jani Nikula <jani.nikula@intel.com> wrote:
>> 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.
stable team said it failed to apply a while back, hence the manual
backport. Not sure what exactly upset things, Peter should know if
there was anything to resolve.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
2015-06-23 11:33 ` Daniel Vetter
@ 2015-06-23 11:35 ` Antoine, Peter
0 siblings, 0 replies; 7+ messages in thread
From: Antoine, Peter @ 2015-06-23 11:35 UTC (permalink / raw
To: Daniel Vetter, Nikula, Jani; +Cc: stable
The code moved around. Seems the indenting changed.
Also it was trying to apply the patch to the wrong place, I think the indenting caused it to try to apply to a different function, which it then failed to apply to.
Peter.
-----Original Message-----
From: daniel.vetter@ffwll.ch [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
Sent: Tuesday, June 23, 2015 12:33 PM
To: Nikula, Jani
Cc: Antoine, Peter; stable
Subject: Re: [PATCH] drm/i915: Avoid GPU hang when coming out of s3 or s4
On Tue, Jun 23, 2015 at 9:12 AM, Jani Nikula <jani.nikula@intel.com> wrote:
>> 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.
stable team said it failed to apply a while back, hence the manual backport. Not sure what exactly upset things, Peter should know if there was anything to resolve.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-06-23 11:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.