drm: Fix locking in drm_atomic_helper_resume
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 31 May 2017 08:38:13 +0000 (10:38 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 31 May 2017 14:35:45 +0000 (16:35 +0200)
commit869e188a35c93f1bad7bf16c32f34a6feb5f79f1
treeda620b7135f48548b9d7ce89a4985cc17917e7b7
parentefd11cc8fa1a6d8aba16bd6aaa774ecc3d02145f
drm: Fix locking in drm_atomic_helper_resume

In the conversion to drop drm_modeset_lock_all and the magic implicit
context I failed to realize that _resume starts out with a pile of
state copies, but not with the locks. And hence drm_atomic_commit
won't grab these for us.

v2: Add locking checks in helpers to make sure we catch this in the
future. Note we can only require the locks in the atomic_check phase,
not in the commit phase. But since any commit is guaranteed to first
run the checks (even for the resume stuff where we use stored
duplicated old state) this should give us full coverage. Requested by
Maarten.

Cc: Jyri Sarha <jsarha@ti.com>
Fixes: a5b8444e289c ("drm/atomic-helper: remove modeset_lock_all from helper_resume")
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170531083813.1390-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_atomic_helper.c