Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2358866rwl; Thu, 6 Apr 2023 09:08:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZCpCwyiO1wZl97OwX+1yqavluIyovrT7N5+5QUaKXqKTcFY82WOjZ1WFZ+u1H26cEP067H X-Received: by 2002:a17:902:ea0d:b0:1a2:7356:1ec8 with SMTP id s13-20020a170902ea0d00b001a273561ec8mr13339620plg.67.1680797306278; Thu, 06 Apr 2023 09:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680797306; cv=none; d=google.com; s=arc-20160816; b=JvQY/mMQQx9Tl9fQTYwVHKRK3rt0VbPSIGKYSrks4nyEqD65nWKMR3k0QAX9RvtdgJ 80Ubk9u4T7FsluosSPNdAANm1wddVmjMet5OhinAzNpqaKhSJEqbGzsmKrYml+t5fzAw 6AKFUj67AqCUN2odqh852zGQF+t4LRjo0g0IBItRMYJVQ5nvWYjWZZYU0tahA7yy1FHd Hh5G+7uUzP1kcsXjQnot90d07yYbGQY3OTbMEphRT2W92NzwGPKjBcjRi6nTg/v1VjqT 939e6fQWOA5cUh0JjHiMX+fVfFvtz9SCztI3bDHPJeRRrf+4wJS6LUD/vNP8AfEGhypd D7ww== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b0050bd8dd1b5asi1598639pge.43.2023.04.06.09.08.06; Thu, 06 Apr 2023 09:08:26 -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 S239940AbjDFQH3 (ORCPT + 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 ); 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 To: Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Benjamin Gaignard , Liam Mark , Brian Starkey , John Stultz , Gerd Hoffmann , Daniel Vetter , Jani Nikula , Arnd Bergmann , Greg Kroah-Hartman , Thomas Zimmermann , Tomi Valkeinen , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Srinivas Kandagatla , Amol Maheshwari , 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, 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: 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 fastrpc for the locking policy update. Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- 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 #include #include -#include #include #include #include @@ -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); } -- 2.39.2