Bug 87094 - [all]igt/drm_read subcases short-buffer-block and short-buffer-nonblock fail
Summary: [all]igt/drm_read subcases short-buffer-block and short-buffer-nonblock fail
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: Other All
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL: http://patchwork.freedesktop.org/patc...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-08 08:17 UTC by Guo Jinxian
Modified: 2017-10-06 14:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (116.34 KB, text/plain)
2014-12-08 08:17 UTC, Guo Jinxian
no flags Details

Description Guo Jinxian 2014-12-08 08:17:28 UTC
Created attachment 110560 [details]
dmesg

==System Environment==
--------------------------
Regression: No
They are new cases

Non-working platforms: HSW BYT

==kernel==
--------------------------
origin/drm-intel-nightly: 2014_12_08(fails)
origin/drm-intel-next-queued: bcfcc8ba29c933ee98c7f498ee7ccfa17be400dd(fails)
    drm/i915: Additional request structure tracing  
origin/drm-intel-fixes: 9cca30688043eb1b6569f794041dfeec218dffa5(works)
    drm/i915: Handle inaccurate time conversion issues

==Bug detailed description==
-----------------------------
igt/drm_read subcases short-buffer-block and short-buffer-nonblock fail

Output:
[root@x-hsw24 tests]# ./drm_read --run-subtest short-buffer-block 
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64) 
Test assertion failure function test_short_buffer, file drm_read.c:148: 
Failed assertion: read(fd, buffer, 4) == 0 
Last errno: 11, Resource temporarily unavailable 
error: -1 != 0 
Subtest short-buffer-block: FAIL (0.000s) 
[root@x-hsw24 tests]# ./drm_read --run-subtest short-buffer-nonblock 
IGT-Version: 1.8-g819e68f (x86_64) (Linux: 3.18.0-rc7_drm-intel-nightly_bfdd01_20141208+ x86_64) 
Test assertion failure function test_short_buffer, file drm_read.c:148: 
Failed assertion: read(fd, buffer, 4) == 0 
Last errno: 11, Resource temporarily unavailable 
error: -1 != 0 
Subtest short-buffer-nonblock: FAIL (0.000s) 


Reproduce steps:
-------------------------
1. ./drm_read --run-subtest short-buffer-block
Comment 1 Chris Wilson 2014-12-08 08:20:15 UTC
http://patchwork.freedesktop.org/patch/38174/
Comment 2 lu hua 2014-12-09 07:39:43 UTC
It impacts all platforms.
Comment 3 Chris Wilson 2015-01-07 18:01:03 UTC
Should be fixed now:

commit b710d754bd4f80be922c40d8c1231d20f8e55e09
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Dec 4 21:03:25 2014 +0000

    drm: Make drm_read() more robust against multithreaded races
    
    The current implementation of drm_read() faces a number of issues:
    
    1. Upon an error, it consumes the event which may lead to the client
    blocking.
    2. Upon an error, it forgets about events already copied
    3. If it fails to copy a single event with O_NONBLOCK it falls into a
    infinite loop of reporting EAGAIN.
    3. There is a race between multiple waiters and blocking reads of the
    events list.
    
    Here, we inline drm_dequeue_event() into drm_read() so that we can take
    the spinlock around the list walking and event copying, and importantly
    reorder the error handling to avoid the issues above.
    
    Cc: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Takashi Iwai <tiwai@suse.de>
    Testcase: igt/drm_read
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 4 Ding Heng 2015-01-08 06:08:19 UTC
commit b710d754bd4f80be922c40d8c1231d20f8e55e09 test result is pass.
verified.
Comment 5 lu hua 2015-01-20 01:44:17 UTC
It also fails on latest drm-intel-fixes kernel.
Comment 6 Elizabeth 2017-10-06 14:33:15 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.