* [PATCH] drm/i915: check if execlist_port is empty before using its content
@ 2016-12-23 5:46 ` changbin.du
0 siblings, 0 replies; 9+ messages in thread
From: changbin.du @ 2016-12-23 5:46 UTC (permalink / raw)
To: daniel.vetter
Cc: jani.nikula, airlied, intel-gfx, dri-devel, linux-kernel, Du, Changbin
From: "Du, Changbin" <changbin.du@intel.com>
This patch fix a crash in function reset_common_ring. In this case,
the port[0].request is null when reset the render ring, so a null
dereference exception is raised. We need to check execlist_port status
first.
[ 35.748034] BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
[ 35.749567] IP: [<ffffffff81521bfe>] reset_common_ring+0xbe/0x150
[ 35.749567] Call Trace:
[ 35.749567] [<ffffffff8150ded0>] i915_gem_reset+0x150/0x270
[ 35.749567] [<ffffffff814d3c0a>] i915_reset+0x8a/0xe0
[ 35.749567] [<ffffffff814d8c21>] i915_reset_and_wakeup+0x131/0x160
[ 35.749567] [<ffffffff815298f0>] ? gen5_read8+0x110/0x110
[ 35.749567] [<ffffffff814dc97a>] i915_handle_error+0xca/0x5a0
[ 35.749567] [<ffffffff813bac9d>] ? scnprintf+0x3d/0x70
[ 35.749567] [<ffffffff814dd063>] i915_hangcheck_elapsed+0x213/0x510
[ 35.749567] [<ffffffff810c4c4b>] process_one_work+0x15b/0x470
[ 35.749567] [<ffffffff810c4fa3>] worker_thread+0x43/0x4d0
[ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
[ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
[ 35.749567] [<ffffffff810c103e>] ? call_usermodehelper_exec_async+0x12e/0x130
[ 35.749567] [<ffffffff810ca1a5>] kthread+0xc5/0xe0
[ 35.749567] [<ffffffff810ca0e0>] ? kthread_park+0x60/0x60
[ 35.749567] [<ffffffff810c0f10>] ? umh_complete+0x40/0x40
[ 35.749567] [<ffffffff81a35392>] ret_from_fork+0x22/0x30
Signed-off-by: Changbin Du <changbin.du@intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 0a09024..81a9b0b 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1450,7 +1450,7 @@ static void reset_common_ring(struct intel_engine_cs *engine,
/* Catch up with any missed context-switch interrupts */
I915_WRITE(RING_CONTEXT_STATUS_PTR(engine), _MASKED_FIELD(0xffff, 0));
- if (request->ctx != port[0].request->ctx) {
+ if (!execlists_elsp_idle(engine) && request->ctx != port[0].request->ctx) {
i915_gem_request_put(port[0].request);
port[0] = port[1];
memset(&port[1], 0, sizeof(port[1]));
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] drm/i915: check if execlist_port is empty before using its content
@ 2016-12-23 5:46 ` changbin.du
0 siblings, 0 replies; 9+ messages in thread
From: changbin.du @ 2016-12-23 5:46 UTC (permalink / raw)
To: daniel.vetter; +Cc: airlied, intel-gfx, linux-kernel, dri-devel
From: "Du, Changbin" <changbin.du@intel.com>
This patch fix a crash in function reset_common_ring. In this case,
the port[0].request is null when reset the render ring, so a null
dereference exception is raised. We need to check execlist_port status
first.
[ 35.748034] BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
[ 35.749567] IP: [<ffffffff81521bfe>] reset_common_ring+0xbe/0x150
[ 35.749567] Call Trace:
[ 35.749567] [<ffffffff8150ded0>] i915_gem_reset+0x150/0x270
[ 35.749567] [<ffffffff814d3c0a>] i915_reset+0x8a/0xe0
[ 35.749567] [<ffffffff814d8c21>] i915_reset_and_wakeup+0x131/0x160
[ 35.749567] [<ffffffff815298f0>] ? gen5_read8+0x110/0x110
[ 35.749567] [<ffffffff814dc97a>] i915_handle_error+0xca/0x5a0
[ 35.749567] [<ffffffff813bac9d>] ? scnprintf+0x3d/0x70
[ 35.749567] [<ffffffff814dd063>] i915_hangcheck_elapsed+0x213/0x510
[ 35.749567] [<ffffffff810c4c4b>] process_one_work+0x15b/0x470
[ 35.749567] [<ffffffff810c4fa3>] worker_thread+0x43/0x4d0
[ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
[ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
[ 35.749567] [<ffffffff810c103e>] ? call_usermodehelper_exec_async+0x12e/0x130
[ 35.749567] [<ffffffff810ca1a5>] kthread+0xc5/0xe0
[ 35.749567] [<ffffffff810ca0e0>] ? kthread_park+0x60/0x60
[ 35.749567] [<ffffffff810c0f10>] ? umh_complete+0x40/0x40
[ 35.749567] [<ffffffff81a35392>] ret_from_fork+0x22/0x30
Signed-off-by: Changbin Du <changbin.du@intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 0a09024..81a9b0b 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1450,7 +1450,7 @@ static void reset_common_ring(struct intel_engine_cs *engine,
/* Catch up with any missed context-switch interrupts */
I915_WRITE(RING_CONTEXT_STATUS_PTR(engine), _MASKED_FIELD(0xffff, 0));
- if (request->ctx != port[0].request->ctx) {
+ if (!execlists_elsp_idle(engine) && request->ctx != port[0].request->ctx) {
i915_gem_request_put(port[0].request);
port[0] = port[1];
memset(&port[1], 0, sizeof(port[1]));
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: check if execlist_port is empty before using its content
2016-12-23 5:46 ` changbin.du
(?)
@ 2016-12-23 6:23 ` Patchwork
-1 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2016-12-23 6:23 UTC (permalink / raw)
To: changbin.du; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: check if execlist_port is empty before using its content
URL : https://patchwork.freedesktop.org/series/17162/
State : success
== Summary ==
Series 17162v1 drm/i915: check if execlist_port is empty before using its content
https://patchwork.freedesktop.org/api/1.0/series/17162/revisions/1/mbox/
fi-bdw-5557u total:246 pass:232 dwarn:0 dfail:0 fail:0 skip:14
fi-bsw-n3050 total:246 pass:207 dwarn:0 dfail:0 fail:0 skip:39
fi-bxt-j4205 total:246 pass:224 dwarn:0 dfail:0 fail:0 skip:22
fi-bxt-t5700 total:82 pass:69 dwarn:0 dfail:0 fail:0 skip:12
fi-byt-j1900 total:246 pass:219 dwarn:0 dfail:0 fail:0 skip:27
fi-byt-n2820 total:246 pass:215 dwarn:0 dfail:0 fail:0 skip:31
fi-hsw-4770 total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19
fi-hsw-4770r total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19
fi-ivb-3520m total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21
fi-ivb-3770 total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21
fi-kbl-7500u total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6260u total:246 pass:233 dwarn:0 dfail:0 fail:0 skip:13
fi-skl-6700hq total:246 pass:226 dwarn:0 dfail:0 fail:0 skip:20
fi-skl-6700k total:246 pass:222 dwarn:3 dfail:0 fail:0 skip:21
fi-skl-6770hq total:246 pass:233 dwarn:0 dfail:0 fail:0 skip:13
fi-snb-2600 total:246 pass:214 dwarn:0 dfail:0 fail:0 skip:32
7165fdc7f0b0b536557fcd0a222d083a901be57c drm-tip: 2016y-12m-22d-19h-42m-25s UTC integration manifest
a00749b drm/i915: check if execlist_port is empty before using its content
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3382/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: check if execlist_port is empty before using its content
2016-12-23 5:46 ` changbin.du
@ 2016-12-23 7:04 ` Jani Nikula
-1 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-12-23 7:04 UTC (permalink / raw)
To: changbin.du, daniel.vetter
Cc: airlied, intel-gfx, dri-devel, linux-kernel, Du, Changbin
On Fri, 23 Dec 2016, changbin.du@intel.com wrote:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> This patch fix a crash in function reset_common_ring. In this case,
> the port[0].request is null when reset the render ring, so a null
> dereference exception is raised. We need to check execlist_port status
> first.
>
> [ 35.748034] BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
> [ 35.749567] IP: [<ffffffff81521bfe>] reset_common_ring+0xbe/0x150
> [ 35.749567] Call Trace:
> [ 35.749567] [<ffffffff8150ded0>] i915_gem_reset+0x150/0x270
> [ 35.749567] [<ffffffff814d3c0a>] i915_reset+0x8a/0xe0
> [ 35.749567] [<ffffffff814d8c21>] i915_reset_and_wakeup+0x131/0x160
> [ 35.749567] [<ffffffff815298f0>] ? gen5_read8+0x110/0x110
> [ 35.749567] [<ffffffff814dc97a>] i915_handle_error+0xca/0x5a0
> [ 35.749567] [<ffffffff813bac9d>] ? scnprintf+0x3d/0x70
> [ 35.749567] [<ffffffff814dd063>] i915_hangcheck_elapsed+0x213/0x510
> [ 35.749567] [<ffffffff810c4c4b>] process_one_work+0x15b/0x470
> [ 35.749567] [<ffffffff810c4fa3>] worker_thread+0x43/0x4d0
> [ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
> [ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
> [ 35.749567] [<ffffffff810c103e>] ? call_usermodehelper_exec_async+0x12e/0x130
> [ 35.749567] [<ffffffff810ca1a5>] kthread+0xc5/0xe0
> [ 35.749567] [<ffffffff810ca0e0>] ? kthread_park+0x60/0x60
> [ 35.749567] [<ffffffff810c0f10>] ? umh_complete+0x40/0x40
> [ 35.749567] [<ffffffff81a35392>] ret_from_fork+0x22/0x30
>
Fixes: ?
i.e. which commit broke things?
BR,
Jani.
> Signed-off-by: Changbin Du <changbin.du@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 0a09024..81a9b0b 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1450,7 +1450,7 @@ static void reset_common_ring(struct intel_engine_cs *engine,
>
> /* Catch up with any missed context-switch interrupts */
> I915_WRITE(RING_CONTEXT_STATUS_PTR(engine), _MASKED_FIELD(0xffff, 0));
> - if (request->ctx != port[0].request->ctx) {
> + if (!execlists_elsp_idle(engine) && request->ctx != port[0].request->ctx) {
> i915_gem_request_put(port[0].request);
> port[0] = port[1];
> memset(&port[1], 0, sizeof(port[1]));
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: check if execlist_port is empty before using its content
@ 2016-12-23 7:04 ` Jani Nikula
0 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-12-23 7:04 UTC (permalink / raw)
To: changbin.du, daniel.vetter; +Cc: airlied, intel-gfx, linux-kernel, dri-devel
On Fri, 23 Dec 2016, changbin.du@intel.com wrote:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> This patch fix a crash in function reset_common_ring. In this case,
> the port[0].request is null when reset the render ring, so a null
> dereference exception is raised. We need to check execlist_port status
> first.
>
> [ 35.748034] BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
> [ 35.749567] IP: [<ffffffff81521bfe>] reset_common_ring+0xbe/0x150
> [ 35.749567] Call Trace:
> [ 35.749567] [<ffffffff8150ded0>] i915_gem_reset+0x150/0x270
> [ 35.749567] [<ffffffff814d3c0a>] i915_reset+0x8a/0xe0
> [ 35.749567] [<ffffffff814d8c21>] i915_reset_and_wakeup+0x131/0x160
> [ 35.749567] [<ffffffff815298f0>] ? gen5_read8+0x110/0x110
> [ 35.749567] [<ffffffff814dc97a>] i915_handle_error+0xca/0x5a0
> [ 35.749567] [<ffffffff813bac9d>] ? scnprintf+0x3d/0x70
> [ 35.749567] [<ffffffff814dd063>] i915_hangcheck_elapsed+0x213/0x510
> [ 35.749567] [<ffffffff810c4c4b>] process_one_work+0x15b/0x470
> [ 35.749567] [<ffffffff810c4fa3>] worker_thread+0x43/0x4d0
> [ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
> [ 35.749567] [<ffffffff810c4f60>] ? process_one_work+0x470/0x470
> [ 35.749567] [<ffffffff810c103e>] ? call_usermodehelper_exec_async+0x12e/0x130
> [ 35.749567] [<ffffffff810ca1a5>] kthread+0xc5/0xe0
> [ 35.749567] [<ffffffff810ca0e0>] ? kthread_park+0x60/0x60
> [ 35.749567] [<ffffffff810c0f10>] ? umh_complete+0x40/0x40
> [ 35.749567] [<ffffffff81a35392>] ret_from_fork+0x22/0x30
>
Fixes: ?
i.e. which commit broke things?
BR,
Jani.
> Signed-off-by: Changbin Du <changbin.du@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 0a09024..81a9b0b 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1450,7 +1450,7 @@ static void reset_common_ring(struct intel_engine_cs *engine,
>
> /* Catch up with any missed context-switch interrupts */
> I915_WRITE(RING_CONTEXT_STATUS_PTR(engine), _MASKED_FIELD(0xffff, 0));
> - if (request->ctx != port[0].request->ctx) {
> + if (!execlists_elsp_idle(engine) && request->ctx != port[0].request->ctx) {
> i915_gem_request_put(port[0].request);
> port[0] = port[1];
> memset(&port[1], 0, sizeof(port[1]));
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: check if execlist_port is empty before using its content
2016-12-23 5:46 ` changbin.du
@ 2016-12-23 7:51 ` Chris Wilson
-1 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2016-12-23 7:51 UTC (permalink / raw)
To: changbin.du; +Cc: daniel.vetter, airlied, intel-gfx, linux-kernel, dri-devel
On Fri, Dec 23, 2016 at 01:46:36PM +0800, changbin.du@intel.com wrote:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> This patch fix a crash in function reset_common_ring. In this case,
> the port[0].request is null when reset the render ring, so a null
> dereference exception is raised. We need to check execlist_port status
> first.
No. The root cause is whatever got you into the illegal condition in the
first place.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: check if execlist_port is empty before using its content
@ 2016-12-23 7:51 ` Chris Wilson
0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2016-12-23 7:51 UTC (permalink / raw)
To: changbin.du; +Cc: daniel.vetter, intel-gfx, linux-kernel, dri-devel
On Fri, Dec 23, 2016 at 01:46:36PM +0800, changbin.du@intel.com wrote:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> This patch fix a crash in function reset_common_ring. In this case,
> the port[0].request is null when reset the render ring, so a null
> dereference exception is raised. We need to check execlist_port status
> first.
No. The root cause is whatever got you into the illegal condition in the
first place.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [Intel-gfx] [PATCH] drm/i915: check if execlist_port is empty before using its content
2016-12-23 7:51 ` Chris Wilson
@ 2016-12-26 7:41 ` Du, Changbin
-1 siblings, 0 replies; 9+ messages in thread
From: Du, Changbin @ 2016-12-26 7:41 UTC (permalink / raw)
To: Chris Wilson; +Cc: Vetter, Daniel, airlied, intel-gfx, linux-kernel, dri-devel
> On Fri, Dec 23, 2016 at 01:46:36PM +0800, changbin.du@intel.com wrote:
> > From: "Du, Changbin" <changbin.du@intel.com>
> >
> > This patch fix a crash in function reset_common_ring. In this case,
> > the port[0].request is null when reset the render ring, so a null
> > dereference exception is raised. We need to check execlist_port status
> > first.
>
> No. The root cause is whatever got you into the illegal condition in the
> first place.
> -Chris
>
Thanks, I will restudy the code after process my current job. Since this happen
on gvt guest, so this may related to gvt emulation.
> --
> Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: check if execlist_port is empty before using its content
@ 2016-12-26 7:41 ` Du, Changbin
0 siblings, 0 replies; 9+ messages in thread
From: Du, Changbin @ 2016-12-26 7:41 UTC (permalink / raw)
To: Chris Wilson; +Cc: airlied, Vetter, Daniel, intel-gfx, linux-kernel, dri-devel
> On Fri, Dec 23, 2016 at 01:46:36PM +0800, changbin.du@intel.com wrote:
> > From: "Du, Changbin" <changbin.du@intel.com>
> >
> > This patch fix a crash in function reset_common_ring. In this case,
> > the port[0].request is null when reset the render ring, so a null
> > dereference exception is raised. We need to check execlist_port status
> > first.
>
> No. The root cause is whatever got you into the illegal condition in the
> first place.
> -Chris
>
Thanks, I will restudy the code after process my current job. Since this happen
on gvt guest, so this may related to gvt emulation.
> --
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-12-26 7:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23 5:46 [PATCH] drm/i915: check if execlist_port is empty before using its content changbin.du
2016-12-23 5:46 ` changbin.du
2016-12-23 6:23 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-12-23 7:04 ` [PATCH] " Jani Nikula
2016-12-23 7:04 ` Jani Nikula
2016-12-23 7:51 ` [Intel-gfx] " Chris Wilson
2016-12-23 7:51 ` Chris Wilson
2016-12-26 7:41 ` Du, Changbin
2016-12-26 7:41 ` Du, Changbin
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.