Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3719919rwd; Mon, 29 May 2023 15:55:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7tf0S4tWeFK+dO4+IjyWC2icsIutYA2ldIAQAPdODXFH9h5YX4mmm/SzmqkB3Bo0234aTt X-Received: by 2002:a05:6a00:1826:b0:64d:3e7f:7121 with SMTP id y38-20020a056a00182600b0064d3e7f7121mr130690pfa.22.1685400910637; Mon, 29 May 2023 15:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685400910; cv=none; d=google.com; s=arc-20160816; b=Ve4fs4Jp3BKVnTV+xkdC2l4CzpiVVHNE61A+M2lFVkcFpFI/2CYwiSlZGE0QKKKyn+ YSRj36werK71Uv2oprqTQjNnyJWBJM5ivW3C0TxBp00xuqbKXqsrPyWSMIaOH0B/261Z icEnWEuQD6daC9sX8im0fwSqP81DCpSBY45TZvJe1K4P+ezeflyhelH1nWWv28+gcXrE VSWYMU2O8ZCFVYX5M4VYd8LgRAS/ncLA6k5CzSsADzJjsPXBwSJpsGSKxHZYOZ1qMoZn 4H8ugaVxOFNMu4o8GGjLTIW+AW6ZDMMCr+YlmAkpcA0C0YTf1tegqZmu7XMho9HqaDKC Dihw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kj/zAFLAiL2fwTowBctieXhKy/WV8AsPK7/YUrm5ZxY=; b=pP0ctc4EppK81AgPnmMy3GjcOfY8LNNdq1mBcbZE7vifhwYImudeOwjSmC1dK08uoi I61dtuBBh+pyqRnbL/zd36ZjbvU0ImuCHo/J4BhW64oF9FSZaB5lp2u/NeLuq6sZU+2u nlIeIEHu18Zh1iEM1+IlIZl0vCz2xRKkBLBBvkduhIaKjPaoYA4nCrJerKy9cdfydLxQ yzjSOZOVdu5pwfiqasQtvqo35ECQmW05ZEWQJhAss/bikEkc5l9CrZpHWxtbbvXRJr2f tEIrO8i5SOpFW5wXbSFSglX5WJnveOgwL/vvfE3+qwRS9UIBlVH/x/VqFFI0NkNkGYeB Ctjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UdNDdM3K; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020aa7950c000000b0063b64166faesi88334pfp.157.2023.05.29.15.54.58; Mon, 29 May 2023 15:55:10 -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=pass header.i=@collabora.com header.s=mail header.b=UdNDdM3K; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjE2Wqa (ORCPT + 99 others); Mon, 29 May 2023 18:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbjE2WqT (ORCPT ); Mon, 29 May 2023 18:46:19 -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 41FF3DC; Mon, 29 May 2023 15:46:14 -0700 (PDT) Received: from workpc.. (109-252-150-34.dynamic.spd-mgts.ru [109.252.150.34]) (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 9169666059A4; Mon, 29 May 2023 23:46:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685400373; bh=diSuU8WE+GzMlVnXkaI/r+P2dI6dJeYsLrzxIYvrc1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UdNDdM3K2T/HYTvI+BLbQI3D84sMGjiUTjSdI4bAeuzpLzKt1SMz5e5kXEFMJ5w8l A1pucO/aXTnm26Ci+YbRAknR+4V0/BLgTQcZpLEBwaV/0jRk/Pdk3bqd4l29lmKFuD P3u+em7b2inQ7PxzOxBlxyH4fpFOaymWCok7UjfwamzywV6BtX6DO+DElk3KWupr5E UsSOzMJYjlJezA5XUowbceFB+v4v8lolEXIgVpXThjLtAuq2HPpC5Ls7Mo4edPW7gL k2EAOMf0ilRNaswDEZo6NZh3WyuMkVdr3uiCJWKz8G0q5B5oljoC6ZwSiOS03HZ4Ds HJpO690nOGaig== From: Dmitry Osipenko To: Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Benjamin Gaignard , 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 v4 3/6] udmabuf: Don't assert held reservation lock for dma-buf mmapping Date: Tue, 30 May 2023 01:39:32 +0300 Message-Id: <20230529223935.2672495-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230529223935.2672495-1-dmitry.osipenko@collabora.com> References: <20230529223935.2672495-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 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 740d6e426ee9..277f1afa9552 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; -- 2.40.1