Message ID | 20221017172229.42269-13-dmitry.osipenko@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1561904wrs; Mon, 17 Oct 2022 10:27:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hnpqq7UvgI2f/vAg2mIPEidKidGV5JzSh+37R8fzdT79wgWmcq3a8g3Qwhp6Mi41HekZ8 X-Received: by 2002:a17:90b:1c87:b0:20a:e485:4e21 with SMTP id oo7-20020a17090b1c8700b0020ae4854e21mr14782552pjb.194.1666027629069; Mon, 17 Oct 2022 10:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666027629; cv=none; d=google.com; s=arc-20160816; b=y+RZCK78TtEtB4Gt0WsAQ1mHguv0/mCv2+NGRJ/y+g68eEQDixbp1OT2d69izDSRO1 aAVrte6KaN/6FcdAL2QFb5P+ysz/0MrdTFLdwW2mFmIZiRrxFNKDmzDyFWhptiWJCaV2 cOuYDNEKH9L5D35Ptd8RNysTB+IsL5DfbRNga/TpdksjIoO8pHpXRrwLg4xh1/7F4lO4 cjzwTnK/9mCAcZnRVceCRPHEfi6f2eZjA6eX29Y0oKI5wKFAYA8pjzHfzvJo10DZGQ3B 6YC0pr9EEsEQqBq8I//qyxMLYHQbT/NA09zB+76OgLnd89RolS1G5T/hzg/XxqDM1WKN fnvQ== 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=tBl0/s6uTeo5Q8dXeqYyBlXZljUZy9QeZmp1jQyogFQ=; b=iaOqnhCZiEIP+OmwvCar9k+z6zVgp+ajxdGeWjDA7RFIjSvyTFmfEhhkBpZoS7gKuK a3R6eUkigttCTY+AMwAaX2BNeUM5Z/DIbOiH3vlqctAC93YsnALWZBgYBXBwQ54j+1Dv NJSG089jdwJQHLKJ0dU4r4HE8mJk074xXLSbfwfVfPuaLaa6F/qmoa6FPRPT+XVxuuYS rkrFLsZjg1t5TaMxNSO7oqCMyG7lJUOaMKLTa6g8qsGq/fMSmnvqWwshpksy3blg/e+C fneJX7jbCepasPuHgW0mZWjpQbWkMUjAHkVobcNNjKOTmxQD7BNZNMOosYnol25R9rPX 4Fow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="gAXB8G//"; 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=NONE sp=NONE 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 x70-20020a638649000000b004632044db0asi11058024pgd.190.2022.10.17.10.26.56; Mon, 17 Oct 2022 10:27:09 -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="gAXB8G//"; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbiJQR0D (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Mon, 17 Oct 2022 13:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbiJQRZb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 13:25:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DC5F696C1; Mon, 17 Oct 2022 10:25:00 -0700 (PDT) Received: from dimapc.. (109-252-119-114.nat.spd-mgts.ru [109.252.119.114]) (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 466526602388; Mon, 17 Oct 2022 18:24:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666027498; bh=pCSmC3VPtA7CuegS38L6lty54ziB9yvQFvfJf8KB1ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAXB8G//cO3F3j8AWGrPRrvRsVjlCFBgu2qiaGBgXtYsHwRcF+71r0UkKQMsa/ddR zh6WigfOXVJ7d10exRZYGPPM85AnMle9hUdujUVw5Soqan6bvr6KsluDNdaYd9VaQh ivT4hSLz0yaqXGAaHdn/IK3LGCRvesk0p1PK3Q8pwtySNTx1rLRrk4fkymMiiF2/Vc bo2I05eRJP+kiOM9lY+OEFzrflbPhMyHPcbX7qTUxwtl2LsZ0B2paS9YOZeKunO7D5 7H3cZ9NTpoEX/UkWelf7EQ3K4NbGTTe42nJE9HbFU0Yn00FR4dW/C+wREaUImxtMFC LEl+iVBw8GnyA== From: Dmitry Osipenko <dmitry.osipenko@collabora.com> To: David Airlie <airlied@linux.ie>, Gerd Hoffmann <kraxel@redhat.com>, Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Daniel Almeida <daniel.almeida@collabora.com>, Gert Wollny <gert.wollny@collabora.com>, Gustavo Padovan <gustavo.padovan@collabora.com>, Daniel Stone <daniel@fooishbar.org>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, Rob Clark <robdclark@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, Thierry Reding <thierry.reding@gmail.com>, Tomasz Figa <tfiga@chromium.org>, Marek Szyprowski <m.szyprowski@samsung.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Alex Deucher <alexander.deucher@amd.com>, Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, =?utf-8?q?Thomas_Hellstr?= =?utf-8?q?=C3=B6m?= <thomas_os@shipmail.org>, Qiang Yu <yuq825@gmail.com>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Amol Maheshwari <amahesh@qti.qualcomm.com>, Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>, Juergen Gross <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Tomi Valkeinen <tomba@kernel.org>, Russell King <linux@armlinux.org.uk>, Lucas Stach <l.stach@pengutronix.de>, Christian Gmeiner <christian.gmeiner@gmail.com>, Ruhl Michael J <michael.j.ruhl@intel.com> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Osipenko <digetx@gmail.com>, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com, virtualization@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v7 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification Date: Mon, 17 Oct 2022 20:22:20 +0300 Message-Id: <20221017172229.42269-13-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017172229.42269-1-dmitry.osipenko@collabora.com> References: <20221017172229.42269-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 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?1746956587375805650?= X-GMAIL-MSGID: =?utf-8?q?1746956587375805650?= |
Series |
Move all drivers to a common dma-buf locking convention
|
|
Commit Message
Dmitry Osipenko
Oct. 17, 2022, 5:22 p.m. UTC
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Juergen Gross <jgross@suse.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> --- drivers/xen/gntdev-dmabuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 940e5e9e8a54..4440e626b797 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -600,7 +600,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, gntdev_dmabuf->u.imp.attach = attach; - sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); + sgt = dma_buf_map_attachment_unlocked(attach, DMA_BIDIRECTIONAL); if (IS_ERR(sgt)) { ret = ERR_CAST(sgt); goto fail_detach; @@ -658,7 +658,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, fail_end_access: dmabuf_imp_end_foreign_access(gntdev_dmabuf->u.imp.refs, count); fail_unmap: - dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); + dma_buf_unmap_attachment_unlocked(attach, sgt, DMA_BIDIRECTIONAL); fail_detach: dma_buf_detach(dma_buf, attach); fail_free_obj: @@ -708,8 +708,8 @@ static int dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd) attach = gntdev_dmabuf->u.imp.attach; if (gntdev_dmabuf->u.imp.sgt) - dma_buf_unmap_attachment(attach, gntdev_dmabuf->u.imp.sgt, - DMA_BIDIRECTIONAL); + dma_buf_unmap_attachment_unlocked(attach, gntdev_dmabuf->u.imp.sgt, + DMA_BIDIRECTIONAL); dma_buf = attach->dmabuf; dma_buf_detach(attach->dmabuf, attach); dma_buf_put(dma_buf);