From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33357 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558AbdHRUNM (ORCPT ); Fri, 18 Aug 2017 16:13:12 -0400 Received: by mail-wm0-f68.google.com with SMTP id q189so5321825wmd.0 for ; Fri, 18 Aug 2017 13:13:11 -0700 (PDT) Date: Fri, 18 Aug 2017 22:13:08 +0200 From: Daniel Vetter To: Gustavo Padovan Cc: Maarten Lankhorst , 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: <20170818201308.cubblfgiudlrlrv2@phenom.ffwll.local> References: <20170814100721.13340-1-maarten.lankhorst@linux.intel.com> <20170818165910.GA16306@jade> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170818165910.GA16306@jade> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Aug 18, 2017 at 01:59:10PM -0300, Gustavo Padovan wrote: > 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 Hm somehow this fell through, applied to drm-misc-fixes. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch