Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp43830iog; Tue, 28 Jun 2022 14:31:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUAgT9Q0WSdcEfmb/nN/d2RDbotwCD0ol6oOs3L2KOik5/eqr3Jv85Py4EmlvLnWxeD84c X-Received: by 2002:a17:903:291:b0:168:c6b3:1976 with SMTP id j17-20020a170903029100b00168c6b31976mr5840017plr.9.1656451871076; Tue, 28 Jun 2022 14:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656451871; cv=none; d=google.com; s=arc-20160816; b=C/IKyBUJSxu5Xs1AgTP8XQ7HkijDfAKyrnvvm6b/OgK8jK2C8WjO2pL6teW4r0x/X0 vOJH+fSbEw3FBGJrNxmOq3EHIs5SY+aT9Y9pE472RdPBdG784Ogr9izl+ua73QMdQICE NPlorfS2QsXViW+ZVjj4qYEGhAWtj3Yiy3bM0Y4kU7tCRogxR4FX07pMAEGjtmshSxZf 5w3Q+J72TRtNpVLxqy2Rlp2pDf4VSlKJB7RSRe0WUV3dnQI0JnS0QLShaNhcwgqjSOca /MvvnntmcXoclRqDAdbfkMMbSAghzECjcZW8OIp5yAnnvKFTDLpPjDQsALsxZQOChcM3 LJMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WEcekyMy8Zp70HExlCjHdOg+ByN329MUJVhyp3ZRfu0=; b=hIKfZBgLj8OnfkDxDQNjgy5PXsVlcEDqi695XzTxKA7SxBXBCfmUtNP3mcHGWjL/Bp x6v2UHhs/IMn9LxfM7ihJ/YN1iYpfMvPQzWRGxzci1s6NVovRYpfKabJgM8o5qZ/1w3N V4VkgZMQZa1fo8XIC3Y4U9Fm8yrg1Si6oX2U5tR+pYUv2syyE7/m3fY9+w2xvJ/8XMHP 7GszURzRmb5qTPmcWz2F7rimRxMrxf7Fhy9XBcA6EdoNLtTjD46cavFINSmlbRDgCMzD mRFFTMGtjUQ+swWOCIFEGemLV1ZpOCnkDFo1UBMpx706P8cty70KoYR2wliCZnRIrjri KiGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b="dVFF/BzM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a64-20020a639043000000b0040cc39c0356si19510432pge.548.2022.06.28.14.30.57; Tue, 28 Jun 2022 14:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b="dVFF/BzM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232314AbiF1UVk (ORCPT + 99 others); Tue, 28 Jun 2022 16:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbiF1UVS (ORCPT ); Tue, 28 Jun 2022 16:21:18 -0400 Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B3C743B2A4 for ; Tue, 28 Jun 2022 13:18:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id AC47E3F6D0; Tue, 28 Jun 2022 22:12:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.11 X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Authentication-Results: ste-pvt-msa1.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mmpRsQHvcbQV; Tue, 28 Jun 2022 22:12:58 +0200 (CEST) Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id CDA333F5E5; Tue, 28 Jun 2022 22:12:55 +0200 (CEST) Received: from [192.168.0.209] (h-155-4-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 5504F360156; Tue, 28 Jun 2022 22:12:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1656447175; bh=8qVW4B3M3sdbclxh8UQh5P9peDN3xxFvdDdC5TV32/0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dVFF/BzMCsmmWG2zHPWW6M0VCmuZz4GO4qbbISmpcnG1hjGYEkIoPCt6RUdqXtSN5 Zw7NouOgpWzqOWItxknC6wyoxQz+N4x4jBvrz2P0oIotiPufQ3K9y8CBhGSA/p5GgE mX1Zal2b0Dlj2qezn+xXIo0JguejcKH2kGq5qm/s= Message-ID: Date: Tue, 28 Jun 2022 22:12:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v6 01/22] drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error Content-Language: en-US To: Dmitry Osipenko , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Dmitry Osipenko , kernel@collabora.com, linux-media@vger.kernel.org References: <20220526235040.678984-1-dmitry.osipenko@collabora.com> <20220526235040.678984-2-dmitry.osipenko@collabora.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= In-Reply-To: <20220526235040.678984-2-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 5/27/22 01:50, Dmitry Osipenko wrote: > Use ww_acquire_fini() in the error code paths. Otherwise lockdep > thinks that lock is held when lock's memory is freed after the > drm_gem_lock_reservations() error. The WW needs to be annotated > as "freed" s /WW/ww_acquire_context/ ? s /"freed"/"released"/ ? > , which fixes the noisy "WARNING: held lock freed!" splat > of VirtIO-GPU driver with CONFIG_DEBUG_MUTEXES=y and enabled lockdep. > > Cc: stable@vger.kernel.org Can you dig up the commit in error and add a Fixes: Tag? Using that and "dim fixes" will also make the Cc: stable tag a bit more verbose. With that fixed, Reviewed-by: Thomas Hellström > Signed-off-by: Dmitry Osipenko > --- > drivers/gpu/drm/drm_gem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > index eb0c2d041f13..86d670c71286 100644 > --- a/drivers/gpu/drm/drm_gem.c > +++ b/drivers/gpu/drm/drm_gem.c > @@ -1226,7 +1226,7 @@ drm_gem_lock_reservations(struct drm_gem_object **objs, int count, > ret = dma_resv_lock_slow_interruptible(obj->resv, > acquire_ctx); > if (ret) { > - ww_acquire_done(acquire_ctx); > + ww_acquire_fini(acquire_ctx); > return ret; > } > } > @@ -1251,7 +1251,7 @@ drm_gem_lock_reservations(struct drm_gem_object **objs, int count, > goto retry; > } > > - ww_acquire_done(acquire_ctx); > + ww_acquire_fini(acquire_ctx); > return ret; > } > }