• Maarten Lankhorst's avatar
    drm/atomic: Make drm_atomic_legacy_backoff reset crtc->acquire_ctx · 81e257e9
    Maarten Lankhorst authored
    Atomic updates may acquire more state than initially locked through
    drm_modeset_lock_crtc, running with heavy stress can cause a
    WARN_ON(crtc->acquire_ctx) in drm_modeset_lock_crtc:
    
    [  601.491296] ------------[ cut here ]------------
    [  601.491366] WARNING: CPU: 0 PID: 2411 at
    drivers/gpu/drm/drm_modeset_lock.c:191 drm_modeset_lock_crtc+0xeb/0xf0 [drm]
    [  601.491369] Modules linked in: drm i915 drm_kms_helper
    [  601.491414] CPU: 0 PID: 2411 Comm: kms_cursor_lega Tainted: G     U 4.7.0-rc4-patser+ #4798
    [  601.491417] Hardware name: Intel Corporation Skylake Client
    [  601.491420]  0000000000000000 ffff88044d153c98 ffffffff812ead28 0000000000000000
    [  601.491425]  0000000000000000 ffff88044d153cd8 ffffffff810868e6 000000bf58058030
    [  601.491431]  ffff880088b415e8 ffff880458058030 ffff88008a271548 ffff88008a271568
    [  601.491436] Call Trace:
    [  601.491443]  [<ffffffff812ead28>] dump_stack+0x4d/0x65
    [  601.491447]  [<ffffffff810868e6>] __warn+0xc6/0xe0
    [  601.491452]  [<ffffffff81086968>] warn_slowpath_null+0x18/0x20
    [  601.491472]  [<ffffffffc00d4ffb>] drm_modeset_lock_crtc+0xeb/0xf0 [drm]
    [  601.491491]  [<ffffffffc00c5526>] drm_mode_cursor_common+0x66/0x180 [drm]
    [  601.491509]  [<ffffffffc00c91cc>] drm_mode_cursor_ioctl+0x3c/0x40 [drm]
    [  601.491524]  [<ffffffffc00bc94d>] drm_ioctl+0x14d/0x530 [drm]
    [  601.491540]  [<ffffffffc00c9190>] ? drm_mode_setcrtc+0x520/0x520 [drm]
    [  601.491545]  [<ffffffff81176aeb>] ? handle_mm_fault+0x106b/0x1430
    [  601.491550]  [<ffffffff81108441>] ? stop_one_cpu+0x61/0x70
    [  601.491556]  [<ffffffff811bb71d>] do_vfs_ioctl+0x8d/0x570
    [  601.491560]  [<ffffffff81290d7e>] ? security_file_ioctl+0x3e/0x60
    [  601.491565]  [<ffffffff811bbc74>] SyS_ioctl+0x74/0x80
    [  601.491571]  [<ffffffff810e321c>] ? posix_get_monotonic_raw+0xc/0x10
    [  601.491576]  [<ffffffff8175b11b>] entry_SYSCALL_64_fastpath+0x13/0x8f
    [  601.491581] ---[ end trace 56f3d3d85f000d00 ]---
    
    For good measure, test mode_config.acquire_ctx too, although this should
    never happen.
    
    Testcase: kms_cursor_legacy
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    81e257e9
drm_atomic.c 50.7 KB