Bug 78932 - [HSW/BDW]igt/kms_flip subcases bo-too-big-interruptible and bo-too-big cause system hang
Summary: [HSW/BDW]igt/kms_flip subcases bo-too-big-interruptible and bo-too-big cause ...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Daniel Vetter
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-20 02:24 UTC by Guo Jinxian
Modified: 2017-09-04 10:23 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (41.04 KB, text/plain)
2014-05-20 02:24 UTC, Guo Jinxian
no flags Details
dmesg (104.36 KB, text/plain)
2014-05-27 05:36 UTC, Guo Jinxian
no flags Details

Description Guo Jinxian 2014-05-20 02:24:08 UTC
Created attachment 99369 [details]
dmesg

==System Environment==
--------------------------
Regression: No. 
It's new cases

Non-working platforms: BDW

==kernel==
--------------------------
-nightly: f79ba79cf037eea9ee757ad37730b00f43d5ef80 (works)
-queued: d3b448d9917a3d6531e499d88bfb13ea5e31e4ad (works)
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Fri May 16 18:59:00 2014 +0100

    drm/i915: Only unpin the default ctx object if it exists

    Since commit 691e6415c891b8b2b082a120b896b443531c4d45
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Wed Apr 9 09:07:36 2014 +0100

        drm/i915: Always use kref tracking for all contexts.

    we have contexts everywhere, and so we must be careful to distinguish
    fake contexts, which do not have an associated bo, and real ones, which
    do. In particular, we now need to be careful not to dereference NULL
    pointers.

    This is one such example, as the commit highlighted above failed to move
    the unpinning of the default ctx object into the real-context-only
    branch.

    Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78792
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Ben Widawsky <benjamin.widawsky@intel.com>
    Cc: Mika Kuoppala <mika.kuoppala@intel.com>
    Cc: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

-fixes: e95a2f7509f5219177d6821a0a8754f93892ca56 (fails)
    Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Date:   Thu May 8 15:09:19 2014 +0300

    drm/i915: Increase WM memory latency values on SNB

    On SNB the BIOS provided WM memory latency values seem insufficient to
    handle high resolution displays.

    In this particular case the display mode was a 2560x1440@60Hz, which
    makes the pixel clock 241.5 MHz. It was empirically found that a memory
    latency value if 1.2 usec is enough to avoid underruns, whereas the BIOS
    provided value of 0.7 usec was clearly too low. Incidentally 1.2 usec
    is what the typical BIOS provided values are on IVB systems.

    Increase the WM memory latency values to at least 1.2 usec on SNB.
    Hopefully this won't have a significant effect on power consumption.

    v2: Increase the latency values regardless of the pixel clock

    Cc: Robert N <crshman@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70254
    Tested-by: Robert Navarro <crshman@gmail.com>
    Tested-by: Vitaly Minko <vitaly.minko@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>

==Bug detailed description==
-----------------------------
igt/kms_flip subcases bo-too-big-interruptible and bo-too-big cause system hang

This bug only occurs on -fixes branch

Output:
time ./kms_flip --run-subtest bo-too-big
IGT-Version: 1.6-gd71add5 (x86_64) (Linux: 3.15.0-rc3_drm-intel-fixes_e95a2f_20140519+ x86_64)
Using monotonic timestamps
Beginning bo-too-big on crtc 5, connector 14
  1920x1080 60 1920 1966 1996 2080 1080 1082 1086 1112 0xa 0x48 138780


==Reproduce steps==
---------------------------- 
1. ./kms_flip --run-subtest bo-too-big
Comment 1 Chris Wilson 2014-05-20 06:22:59 UTC
commit 19656430a874132a1d79c56387a6eec1ef9a5689
Author: Oscar Mateo <oscar.mateo@intel.com>
Date:   Fri May 16 14:20:43 2014 +0100

    drm/i915: Gracefully handle obj not bound to GGTT in is_pin_display
    
    Otherwise, we do a NULL pointer dereference.
    
    I've seen this happen while handling an error in
    i915_gem_object_pin_to_display_plane():
    
    If i915_gem_object_set_cache_level() fails, we call is_pin_display()
    to handle the error. At this point, the object is still not pinned
    to GGTT and maybe not even bound, so we have to check before we
    dereference its GGTT vma.
    
    The IGT kms_flip/bo-too-big tests for this bug.
    
    v2: Chris Wilson says restoring the old value is easier, but that
    is_pin_display is useful as a theory of operation. Take the solomonic
    decision: at least this way is_pin_display is a little more robust
    (until Chris can kill it off).
    
    v3: Chris suggests the WARN in i915_gem_obj_to_ggtt has outlived its
    usefulness: add a reminder to remove it.
    
    Issue: VIZ-3772
    Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
    Testcase: igt/kms_flip/bo-too-big
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 2 liulei 2014-05-26 09:25:25 UTC
Verified 
----------------------
[root@x-bdw opt]# ./kms_flip --run-subtest bo-too-big
IGT-Version: 1.6-gff3c122 (x86_64) (Linux: 3.15.0-rc6_drm-intel-nightly_c37f30_20140526+ x86_64)
Using monotonic timestamps
Beginning bo-too-big on crtc 5, connector 14
  1920x1080 60 1920 1966 1996 2080 1080 1082 1086 1112 0xa 0x48 138780
Beginning bo-too-big on crtc 8, connector 14
  1920x1080 60 1920 1966 1996 2080 1080 1082 1086 1112 0xa 0x48 138780
Beginning bo-too-big on crtc 11, connector 14
  1920x1080 60 1920 1966 1996 2080 1080 1082 1086 1112 0xa 0x48 138780
Subtest bo-too-big: SUCCESS
Comment 3 Guo Jinxian 2014-05-27 05:36:24 UTC
Created attachment 99916 [details]
dmesg

This bug still be able to reproduce on latest -fixes(c1240bd2842f6ec26d7dc1d9c845a197a41d33fe) on BDW and IVB.

Output:
 ./kms_flip --run-subtest bo-too-big
IGT-Version: 1.6-gff3c122 (x86_64) (Linux: 3.15.0-rc5_drm-intel-fixes_c1240b_20140527+ x86_64)
Using monotonic timestamps
Beginning bo-too-big on crtc 5, connector 14
  1920x1080 60 1920 1966 1996 2080 1080 1082 1086 1112 0xa 0x48 138780
Comment 4 Daniel Vetter 2014-06-18 15:45:42 UTC
-fixes should have moved forward now.
Comment 5 Guo Jinxian 2014-06-27 06:41:53 UTC
Test passed on latest -nightly(1087d4bf01e79523898c6c31615bf0c369e0039a)

Output:
[root@x-hsw27 tests]# time ./kms_flip --run-subtest bo-too-big
IGT-Version: 1.7-g7ef5372 (x86_64) (Linux: 3.16.0-rc2_drm-intel-nightly_1087d4_20140627+ x86_64)
Using monotonic timestamps
Beginning bo-too-big on crtc 6, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big on crtc 10, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big on crtc 14, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Subtest bo-too-big: SUCCESS

real    0m0.431s
user    0m0.038s
sys     0m0.024s
[root@x-hsw27 tests]# time ./kms_flip --run-subtest bo-too-big-interruptible
IGT-Version: 1.7-g7ef5372 (x86_64) (Linux: 3.16.0-rc2_drm-intel-nightly_1087d4_20140627+ x86_64)
Using monotonic timestamps
Beginning bo-too-big-interruptible on crtc 6, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big-interruptible on crtc 10, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big-interruptible on crtc 14, connector 16
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Subtest bo-too-big-interruptible: SUCCESS

real    0m0.393s
user    0m0.037s
sys     0m0.021s
Comment 6 Guo Jinxian 2014-06-27 06:46:10 UTC
The result on latest -fixes(8525a235c96a548873c6c5644f50df32b31f04c6) was passed too.

Output:
[root@x-hsw27 tests]# time ./kms_flip --run-subtest bo-too-big-interruptible
IGT-Version: 1.7-g7ef5372 (x86_64) (Linux: 3.16.0-rc2_drm-intel-fixes_8525a2_20140626+ x86_64)
Using monotonic timestamps
Beginning bo-too-big-interruptible on crtc 5, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big-interruptible on crtc 8, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big-interruptible on crtc 11, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Subtest bo-too-big-interruptible: SUCCESS

real    0m0.329s
user    0m0.044s
sys     0m0.026s
[root@x-hsw27 tests]# time ./kms_flip --run-subtest bo-too-big
IGT-Version: 1.7-g7ef5372 (x86_64) (Linux: 3.16.0-rc2_drm-intel-fixes_8525a2_20140626+ x86_64)
Using monotonic timestamps
Beginning bo-too-big on crtc 5, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big on crtc 8, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Beginning bo-too-big on crtc 11, connector 13
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 0x5 0x48 108000
Subtest bo-too-big: SUCCESS

real    0m0.262s
user    0m0.033s
sys     0m0.022s
Comment 7 Jari Tahvanainen 2017-09-04 10:23:21 UTC
Closing old verified+fixed.


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.