Message ID | 20230406160637.541702-4-dmitry.osipenko@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1145451vqo; Thu, 6 Apr 2023 09:17:49 -0700 (PDT) X-Google-Smtp-Source: AKy350ZC0lAG+TM0J/Bz6JpMxKleHpOpDEaydRPfyS+PBBiWEnmdYlaUOZ2Wo70qM6jxreXQUmOq X-Received: by 2002:a62:1757:0:b0:62d:dd8b:f42a with SMTP id 84-20020a621757000000b0062ddd8bf42amr10226675pfx.25.1680797869125; Thu, 06 Apr 2023 09:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680797869; cv=none; d=google.com; s=arc-20160816; b=usHYTpnRlqN7gRQhCBeMupRdMP8EyY6yXslZtc7VlZUiKng+4SUAMjntsZ+S6ifIzj rKwBCj/d+5dApyVPdNVoX6yhLOLcy/e2e9KXb1R3/AikLduyqxy34kpOvu/EL061Adxx v57oc5Jd/1sm+qE0VlxdQXdYXTxW+a5DoeZK5ImPOggc/cXXadIBwoIONa/cae7gEkIu GfVGp8agWgWNNTBw/rqQPcDjxif64nlkEtWCutBf3DF4N5gU0KVUjUKZ9FXJiEqXm4MO rI9mXyFK2IbXbpe8gsB1re3f69HQYgGqxnYS6fmeU0TK+y6kgr/pOGYu1Lz7ZT8vU2sm PimQ== 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=Z4nc4XQgzeozpyZvWaKvVlf0vNTGKrgvCBy1bTFBM44=; b=qKo8F9QjSvkXqc2oeQ2iZPmoWhBksMTr4/QGIq1iZPaUA1Qi135izSSHsTF1FcGLDL v7uGUXP6fL+j4ZsYOIhcL+hQZyRTzd7Ksrpdwsi2Z4xMjh+CJkcNnpso1mnlp+rhpR00 zjIi6Nmtjy2wZA469yCPoh/KMihV1r5Gv0fOQwqp+o8L8NWnv7+imuCQzSKTIlnSA84D SQ81yfmtTgwnNFCl4+Ww2cfahI6ubshKeY9FXjjkzj5o5Jf6t9q1PyuZsQf+2FYE1mX7 jfY3fG43D1+bMcGK9uxOQ6O5u6Rz5xJ2WLVYBHguGA9abMXJUqqehZPTrAspfGILCJUJ eVkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="d/WbIEQy"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a638a42000000b00513cefac5bdsi1671002pgd.572.2023.04.06.09.17.20; Thu, 06 Apr 2023 09:17:49 -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="d/WbIEQy"; 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 S239936AbjDFQH1 (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Thu, 6 Apr 2023 12:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239894AbjDFQHT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Apr 2023 12:07: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 C6027A5E1; Thu, 6 Apr 2023 09:07:06 -0700 (PDT) Received: from workpc.. (109-252-119-170.nat.spd-mgts.ru [109.252.119.170]) (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 7007066031DB; Thu, 6 Apr 2023 17:07:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680797225; bh=rvdy/3koIHZzgBU5kiqAP2iCy3wZx5b0JXTIR0fi+xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/WbIEQynYpmc1xVO9rE6G+Vg2FfZlZVZ+cqJCVsXibp41ZjKgUTTdmKOFNrMfjWV 5XrC5G9WTKtE0Uq7Sbzsdo3cqIOKXsltRTuMt/ZMiWERYGogw79oh2CdyEROR0nKke bRZtKiO3xGJC7yACTO6TvVa/ZzqfqHX264+7iDb0ouUuGMTCby6+nKtsR5Nyg2M0DT 2t3C+dQwcG5cTk4rh1EKXgBBB7EiguriqnkPkaPnFeXjnn9fso7kX0+U1NfIBoPp9Y /hXBGXM+bSCXJSxEsYcCI10TyB9WNdXrVoEfj/MqdXbZOyaeYLd/oJZOTypPLVi0jc IrX0m90B64ZEA== From: Dmitry Osipenko <dmitry.osipenko@collabora.com> To: Sumit Semwal <sumit.semwal@linaro.org>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Liam Mark <lmark@codeaurora.org>, Brian Starkey <Brian.Starkey@arm.com>, John Stultz <jstultz@google.com>, Gerd Hoffmann <kraxel@redhat.com>, Daniel Vetter <daniel@ffwll.ch>, Jani Nikula <jani.nikula@linux.intel.com>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thomas Zimmermann <tzimmermann@suse.de>, Tomi Valkeinen <tomba@kernel.org>, Thierry Reding <thierry.reding@gmail.com>, Tomasz Figa <tfiga@chromium.org>, Marek Szyprowski <m.szyprowski@samsung.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Amol Maheshwari <amahesh@qti.qualcomm.com>, Emil Velikov <emil.l.velikov@gmail.com> 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, linux-arm-msm@vger.kernel.org, kernel@collabora.com Subject: [PATCH v2 3/7] udmabuf: Don't assert held reservation lock for dma-buf mmapping Date: Thu, 6 Apr 2023 19:06:33 +0300 Message-Id: <20230406160637.541702-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230406160637.541702-1-dmitry.osipenko@collabora.com> References: <20230406160637.541702-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762444306354451977?= X-GMAIL-MSGID: =?utf-8?q?1762444306354451977?= |
Series |
Move dma-buf mmap() reservation locking down to exporters
|
|
Commit Message
Dmitry Osipenko
April 6, 2023, 4:06 p.m. UTC
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 <emil.l.velikov@gmail.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> --- 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;