Bug 86959

Summary: [SNB+ Regression]igt/gem_reset_stats some subcases causes system hang sporadically
Product: DRI Reporter: Guo Jinxian <jinxianx.guo>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: critical    
Priority: high CC: intel-gfx-bugs
Version: DRI gitKeywords: bisect_pending
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
call trace snapshot
none
drm/i915: Clean the request structure on alloc none

Description Guo Jinxian 2014-12-03 06:10:00 UTC
==System Environment==
--------------------------
Regression: Yes.
Good commit on -next-queued: 65fa5f773196ccc88c4aae43ece9119f092c20a6(2014_11_26), I tried 10 times, doesn't causes system hang.

Non-working platforms: IVB SNB BDW

==kernel==
--------------------------
origin/drm-intel-nightly: 2014_12_03(fails)
origin/drm-intel-next-queued:d06cced8fa81d56e56ab34e93a83236b151c2a76(fails)
    drm/i915: Move init_unused_rings to gem_init_hw
origin/drm-intel-fixes: b0616c5306b342ceca07044dbc4f917d95c4f825(works)
    drm/i915: Unlock panel even when LVDS is disabled

==Bug detailed description==
-----------------------------
igt/gem_reset_stats some subcases causes system hang sporadically, the fail rate about 1 out of 5

==Reproduce steps==
---------------------------- 
1. ./gem_reset_stats --run-subtest ban-render
Comment 1 Guo Jinxian 2014-12-03 06:11:04 UTC
Created attachment 110390 [details]
call trace snapshot
Comment 2 Mika Kuoppala 2014-12-05 17:50:11 UTC
Created attachment 110497 [details] [review]
drm/i915: Clean the request structure on alloc
Comment 3 Daniel Vetter 2014-12-05 20:43:08 UTC
commit f4cbb3a5f707ae4155beaf103adf50351f6509a0
Author: John Harrison <John.C.Harrison@Intel.com>
Date:   Fri Dec 5 13:49:34 2014 +0000

    drm/i915: Zero fill the request structure
    
    There is a general theory that kzmalloc is better/safer than kmalloc, especially
    for interesting data structures. This change updates the request structure
    allocation to be zero filled.
    
    This also fixes crashes in the reset code. Quoting Mika's patch:
    
    "Clean the request structure on alloc. Otherwise we might end up
    referencing uninitialized fields.  This is apparent when we try to
    cleanup the preallocated request on ring reset, before any request has
    been submitted to the ring.  The request->ctx is foobar and we end up
    freeing the foobarness."
    
    Note that this fixes a regression introduced in
    
    commit 9eba5d4a1d79d5094321469479b4dbe418f60110
    Author: John Harrison <John.C.Harrison@Intel.com>
    Date:   Mon Nov 24 18:49:23 2014 +0000
    
        drm/i915: Ensure OLS & PLR are always in sync
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=86959
    References: https://bugs.freedesktop.org/show_bug.cgi?id=86962
    References: https://bugs.freedesktop.org/show_bug.cgi?id=86992
    Change-Id: I68715ef758025fab8db763941ef63bf60d7031e2
    For: VIZ-4377
    Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
    Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com>
    Cc: Mika Kuoppala <mika.kuoppala@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 4 Guo Jinxian 2014-12-08 03:13:02 UTC
Verified on latest -nightly(bfdd01aa1825aa0068f9236b21362b550f6d630f)

[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (12.512s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (12.343s)
You have new mail in /var/spool/mail/root
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (11.912s)
You have new mail in /var/spool/mail/root
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (11.848s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (12.455s)
You have new mail in /var/spool/mail/root
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (11.631s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (10.464s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (10.568s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (10.857s)
[root@x-hsw27 tests]# ./gem_reset_stats --run-subtest ban-render
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64)
Subtest ban-render: SUCCESS (10.783s)
You have new mail in /var/spool/mail/root
Comment 5 Elizabeth 2017-10-06 14:33:21 UTC
Closing old verified.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.