From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gustavo Padovan Subject: Re: [PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly Date: Fri, 18 Aug 2017 13:59:10 -0300 Message-ID: <20170818165910.GA16306@jade> References: <20170814100721.13340-1-maarten.lankhorst@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170814100721.13340-1-maarten.lankhorst@linux.intel.com> Sender: stable-owner@vger.kernel.org To: Maarten Lankhorst Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , intel-gfx@lists.freedesktop.org, "# v4 . 10+" , Gustavo Padovan List-Id: dri-devel@lists.freedesktop.org 2017-08-14 Maarten Lankhorst : > 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 > Cc: Brian Starkey (v10) > Cc: Sean Paul > Cc: Daniel Vetter > Cc: Jani Nikula > Cc: David Airlie > Signed-off-by: Maarten Lankhorst > Cc: # 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