[PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly

Daniel Vetter daniel at ffwll.ch
Fri Aug 18 20:13:08 UTC 2017


On Fri, Aug 18, 2017 at 01:59:10PM -0300, Gustavo Padovan wrote:
> 2017-08-14 Maarten Lankhorst <maarten.lankhorst at linux.intel.com>:
> 
> > complete_crtc_signaling is freeing fence_state, but when retrying
> > num_fences and fence_state are not zero'd. This caused duplicate
> > fd's in the fence_state array, followed by a BUG_ON in fs/file.c
> > because we reallocate freed memory, and installing over an existing
> > fd, or potential other fun.
> > 
> > Zero fence_state and num_fences correctly in the retry loop, which
> > allows kms_atomic_transition to pass.
> > 
> > Fixes: beaf5af48034 ("drm/fence: add out-fences support")
> > Cc: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
> > Cc: Brian Starkey <brian.starkey at arm.com> (v10)
> > Cc: Sean Paul <seanpaul at chromium.org>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > Cc: David Airlie <airlied at linux.ie>
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > Cc: <stable at vger.kernel.org> # v4.10+
> > Testcase: kms_atomic_transitions.plane-all-modeset-transition-fencing
> > (with CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y)
> > ---
> >  drivers/gpu/drm/drm_atomic.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.com>

Hm somehow this fell through, applied to drm-misc-fixes.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list