Message ID | 20230521205112.150206-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 b10csp1051349vqo; Sun, 21 May 2023 14:01:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LSeFzqgOVHnnk5cIUXu6UnFu8Ay/kFmvACYHgAS4d958S7dFwKH7+Ot8xVzrt9vZ9lxgZ X-Received: by 2002:a17:902:d4d0:b0:1ac:83d1:9269 with SMTP id o16-20020a170902d4d000b001ac83d19269mr10199932plg.16.1684702890868; Sun, 21 May 2023 14:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684702890; cv=none; d=google.com; s=arc-20160816; b=r2H+u4TsXa6LdWJoEA7oIuKsOikfz4pkCWXMuxz1WhP0G6rE+lF9WFF7gwW9IZSIIk yOaJx1CLrqHVn5K4MmUfnUQ9SZvGAPvr5csdk7lJcW2nfMFqDweR+w4pYYUBYAdoVCfn RaUcLqIf7AY1drFZAh8QIBa70nMds6nx72fMS3oCUr5S4j5WBCaZsm/8bD9y4jACtIb+ QnQfLpCjdhc0K3j2jGEV+TSWVJg/83FCr5JquNaipldOzsJtoQCTMvWke29KeqjNJAbc 3Wj1WQOwvl8G9eof0bQpnR/rgR6h7h9Xi7i6XPaKLyYpA+bYmBmFt6X/Z+sMuLHa177y Nkpw== 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=b7KZjGlP6gXtorYYl6rn81WvI7cn3aoTwzvNtqMgBAw=; b=gsvIwvxMBpnHbbBOM+dlHCL5DD6R6GN24Lxf47873BK3/8Ysjqtff7y+w+hv7C5VHN h1889d7HnZfunVpJbcEIuu497QD5FLsVVtWZLaIdVrH6UlD7x3++6VaUBj0fLXlNrBrZ FHZ5m3JsnwHiCh5nkmiHoHuiLZwYwaJ9MwVxangxv5t1zCkwJz22BCrtDRmpikvC8Mg3 WR9+iQqhVkCPzvv+2QD/KJPFQ5DwknTEcA5DZ0CIQB728u/3+TGhDBwcfZgyu/eFfgbz dVtEINmlj4dfbeEykbg0fPO1zgjVaj4A30Fvdyw9OhwMyLqplAvsGmSKkuUOZLlfcMTr ThJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=G11I7dSr; 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 jj13-20020a170903048d00b001adfe96d41esi3342297plb.566.2023.05.21.14.01.16; Sun, 21 May 2023 14:01:30 -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=G11I7dSr; 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 S231228AbjEUVAS (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Sun, 21 May 2023 17:00:18 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <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>, 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>, 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, 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 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: <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?1766539018425600087?= X-GMAIL-MSGID: =?utf-8?q?1766539018425600087?= |
Series |
Move dma-buf mmap() reservation locking down to exporters
|
|
Commit Message
Dmitry Osipenko
May 21, 2023, 8:51 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 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;