Message ID | 20230406160637.541702-5-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 b10csp1150859vqo; Thu, 6 Apr 2023 09:26:25 -0700 (PDT) X-Google-Smtp-Source: AKy350bxX2m80qS3QWrMqFqkXkT4wMJdMjtmWZtjlL/RvANBoo134Y6Yx1xXSISC8yb6NavFaQh+ X-Received: by 2002:a17:902:f34b:b0:1a4:fab2:5f87 with SMTP id q11-20020a170902f34b00b001a4fab25f87mr2830526ple.22.1680798385155; Thu, 06 Apr 2023 09:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680798385; cv=none; d=google.com; s=arc-20160816; b=uBBEscN5Uqco77J8AqK/YWHzE2uX9S420zrae+oYq0GHzHxjDAzmDOBnopMcKni0tz wQ+tWBAij1ZCKfQt6RcCEVSwmU1JXYp8Mldmggs7Q5zFXjaLIndjOkE+fxzc1DRi3Igd rm6JyBAOiFVsVgZHgHLanUAoSNw7LXc36TAqQ3XVaWhH3GOhaXeBJcClvyk/sUkZ9fsA N/0BncBijAkUkYjYhUDbsYwxjataM+UdmNIxL4D2idzr7cSmRw+8UPXOVZJhdcKS8vwy cXkYJcddXjy03lL6grXNzBfli0ymacG7SiApjK3vgHFre+CQJisMGDaKyhV1Uccd8dm2 Py1g== 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=6LovXslpMrTcRSklDWLR8jcgPgFbIsBDTkQn0PnXIAc=; b=JxDAd7v6cCp57WtZv1vMW+xCjdrfVzwT2v5O0auc8Va3XXK0/6RieVrdLrsOND7Kiu lifweCO+tJ+ZMWzL4eLUOjiMRJCezPxU56nZkSfGLl618LvUba8FpOscMnh/f9NQuXuN LRhQHicIwkYT0tI/LSAuA0hD1Qi1ZD40NdWXA4tlUB3JAgR5E6XfYh5Bkc6mrsNWUFDc 98i8Ut6gvMftC9PoBQ3gMJzuCHyr1kpFainhFEEN5N/lOIt7RxRRtwVKgDYr00T1F6cw f2jusC8pDAk2DF9C1cha+6mufT/hmHixcJ3IePhzJmnUZo7ZJfThKdK6q5p1wayYVyAZ Iypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CBhAGKo6; 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 ks4-20020a170903084400b0019acd30dc69si2030485plb.115.2023.04.06.09.26.11; Thu, 06 Apr 2023 09:26:25 -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=CBhAGKo6; 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 S239941AbjDFQH3 (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Thu, 6 Apr 2023 12:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239913AbjDFQHV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Apr 2023 12:07:21 -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 E9E0FA5FB; Thu, 6 Apr 2023 09:07:08 -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 B5DED66031E0; Thu, 6 Apr 2023 17:07:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680797227; bh=+y9WRIJ4shQTe2dz4WBdbVwQw7y2f8JJMM7aQYwXu1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CBhAGKo6G+0QBfaJo75kb4LKjTBYR2m6NK1xy5J0DRNvIebZ9QaxkjBr9agK4Rfuy ya/DQ9dnvLpP+edoT6nG21XhAwBhG60O1YO7t1DqYlUrGKbRLXi+u3BbSKpek0Q1el ws6XQty7fBHw0izzYZMPNNq6cqpE6zk8TekNCpy6hig7/HWwD4iPzPpEcZuTbboNp2 1tz7YmR5XokeqFuKb4iQE3yXW/2rybS3mjbmFlsPsmK8fyxFps2Nrde+Yo5ySOeK0q DJP1wS9uzUngRbwvYc5t+wO3ku3aqPK2XWdhMfQeLveiQjy6rtG3zyIV/KdDBE6Gn0 0bpHdsfZmKfFQ== 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 4/7] fastrpc: Don't assert held reservation lock for dma-buf mmapping Date: Thu, 6 Apr 2023 19:06:34 +0300 Message-Id: <20230406160637.541702-5-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?1762444846980166772?= X-GMAIL-MSGID: =?utf-8?q?1762444846980166772?= |
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 fastrpc for the locking policy update. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> --- drivers/misc/fastrpc.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index a701132638cf..7e9c9ad37fd9 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -6,7 +6,6 @@ #include <linux/device.h> #include <linux/dma-buf.h> #include <linux/dma-mapping.h> -#include <linux/dma-resv.h> #include <linux/idr.h> #include <linux/list.h> #include <linux/miscdevice.h> @@ -733,8 +732,6 @@ static int fastrpc_mmap(struct dma_buf *dmabuf, struct fastrpc_buf *buf = dmabuf->priv; size_t size = vma->vm_end - vma->vm_start; - dma_resv_assert_held(dmabuf->resv); - return dma_mmap_coherent(buf->dev, vma, buf->virt, FASTRPC_PHYS(buf->phys), size); }