From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:38230 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbdHRQ7R (ORCPT ); Fri, 18 Aug 2017 12:59:17 -0400 Received: by mail-qt0-f194.google.com with SMTP id p3so9393828qtg.5 for ; Fri, 18 Aug 2017 09:59:17 -0700 (PDT) Date: Fri, 18 Aug 2017 13:59:10 -0300 From: Gustavo Padovan To: Maarten Lankhorst Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , intel-gfx@lists.freedesktop.org, "# v4 . 10+" , Gustavo Padovan Subject: Re: [PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly 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 Content-Disposition: inline In-Reply-To: <20170814100721.13340-1-maarten.lankhorst@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: 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