From patchwork Sun May 21 20:51:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 13249558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7917C77B73 for ; Sun, 21 May 2023 21:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbjEUVAQ (ORCPT ); Sun, 21 May 2023 17:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231161AbjEUVAM (ORCPT ); Sun, 21 May 2023 17:00:12 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38EC7DD; Sun, 21 May 2023 14:00:11 -0700 (PDT) Received: from workpc.. (109-252-147-95.dynamic.spd-mgts.ru [109.252.147.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id AA93B6605901; Sun, 21 May 2023 22:00:07 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684702810; bh=+OAM+FuLsoM/JJ301uDl3dz9cuHMlNKF1T1FvXy0LZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G11I7dSr5BVRWz6xyJybPAD8XIvQ6rhL/dNTU+n4jm6Iw/Sp1I0aFY/pmhjK3VCKL wcoJzxehvfxSB8kwEN/Vaj0CaPgy6M2QLu4djPjVF2V6/mZNmwHIr1iLRvTlRVZbFS 3b77pc+cNlbZzMxCL9uxugEKmVjVXbd1NsCLa9pIDVzyiBfiXIiO3fERemTjpFpPJK 5BtiHWYf0KoS4cHXuhTrQx3JLw47g4zn4f8GMSqgrg6TyaKD9zJ5X/odVqi+/53UjE JnXuBWFtxTsw22Ko42O5pXvSU8ur0U6tg98k7iNse3eyvQxDw7Qw0dSCqNYFdWcSNr O+9h/KcEQnjHg== From: Dmitry Osipenko To: Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Benjamin Gaignard , Liam Mark , Brian Starkey , John Stultz , Gerd Hoffmann , Daniel Vetter , Jani Nikula , Arnd Bergmann , Thomas Zimmermann , Tomi Valkeinen , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Emil Velikov Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, kernel@collabora.com Subject: [PATCH v3 3/6] udmabuf: Don't assert held reservation lock for dma-buf mmapping Date: Sun, 21 May 2023 23:51:09 +0300 Message-Id: <20230521205112.150206-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230521205112.150206-1-dmitry.osipenko@collabora.com> References: <20230521205112.150206-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Don't assert held dma-buf reservation lock on memory mapping of exported buffer. We're going to change dma-buf mmap() locking policy such that exporters will have to handle the lock. The previous locking policy caused deadlock problem for DRM drivers in a case of self-imported dma-bufs once these drivers are moved to use reservation lock universally. The problem is solved by moving the lock down to exporters. This patch prepares udmabuf for the locking policy update. Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/udmabuf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 01f2e86f3f7c..06729cd60136 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -52,8 +52,6 @@ static int mmap_udmabuf(struct dma_buf *buf, struct vm_area_struct *vma) { struct udmabuf *ubuf = buf->priv; - dma_resv_assert_held(buf->resv); - if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0) return -EINVAL;