[Bug 106832] [i915]Kernel panic occurs after ECHO 15 to /sys/kernel/debug/dri/0/i915_wedged

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 6 02:26:41 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=106832

Owen Zhang <owen.zhang at intel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |owen.zhang at intel.com

--- Comment #7 from Owen Zhang <owen.zhang at intel.com> ---
Created attachment 140479
  --> https://bugs.freedesktop.org/attachment.cgi?id=140479&action=edit
draft one fix patch on kernel 4.14

Hi Joonas and all,

Could you help to have a look this fix on 4.14 LTS?
due to we need one fix on our MSS release, so we made one fix patch based on
4.14. this changes can avoid the kernel panic.
pls kindly give your any comments and suggestions? thanks very much.

here coped the changes, Appreciate your comments.

---
 drivers/gpu/drm/i915/i915_gem.c  |  6 ++++--
 drivers/gpu/drm/i915/intel_lrc.c | 17 +++++++++++------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 877e3b6..45f8130 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3058,8 +3058,10 @@ static void engine_set_wedged(struct intel_engine_cs
*engine)
                for (n = 0; n < ARRAY_SIZE(engine->execlist_port); n++) {
                        struct drm_i915_gem_request *rq =
port_request(&port[n]);

-                       intel_engine_context_out(rq->engine);
-                       i915_gem_request_put(rq);
+                       if(rq) {
+                               intel_engine_context_out(rq->engine);
+                               i915_gem_request_put(rq);
+                       }
                }
                memset(engine->execlist_port, 0,
sizeof(engine->execlist_port));
                engine->execlist_queue = RB_ROOT;
diff --git a/drivers/gpu/drm/i915/intel_lrc.c
b/drivers/gpu/drm/i915/intel_lrc.c
index 50e9641..e620b4d 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1411,13 +1411,18 @@ static void reset_common_ring(struct intel_engine_cs
*engine,
                return;
        }

-       if (request->ctx != port_request(port)->ctx) {
-               i915_gem_request_put(port_request(port));
-               port[0] = port[1];
-               memset(&port[1], 0, sizeof(port[1]));
-       }
+       /* if the request in ELSP had been processed after GPU finished
+        * HW reset, this GPU reset occur when a forced request.
+        * */
+       if (port_request(port)) {
+               if (request->ctx != port_request(port)->ctx) {
+                       i915_gem_request_put(port_request(port));
+                       port[0] = port[1];
+                       memset(&port[1], 0, sizeof(port[1]));
+               }

-       GEM_BUG_ON(request->ctx != port_request(port)->ctx);
+               GEM_BUG_ON(request->ctx != port_request(port)->ctx);
+       }

        /* If the request was innocent, we leave the request in the ELSP
         * and will try to replay it on restarting. The context image may

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20180706/1ef203b0/attachment-0001.html>


More information about the intel-gfx-bugs mailing list