Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2358776rwl; Thu, 6 Apr 2023 09:08:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YRQlygLVicyKuQzqZUqnsY9nzaIGx6eTreA86B3/SLmwbnawCGOOiCGxJ1ZQLdc3vBmafA X-Received: by 2002:a17:902:fa0d:b0:1a0:f8ba:ae55 with SMTP id la13-20020a170902fa0d00b001a0f8baae55mr8954361plb.7.1680797303149; Thu, 06 Apr 2023 09:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680797303; cv=none; d=google.com; s=arc-20160816; b=UTjpA3b8DtgFepAt+IZ8JHxgfa12/iWgASKFEEiFndUCXeQfRrjgcm8mapyGrLG7SS YYYnTGP4JfEgmEAWUVMAGiBjVUNYOjvm3auGzZT2Ww5al/Iq/hfqTjTFsE3NiyfqTxzu Dvc+nGfs2AhGRJ6wAbviZ/P37+0uX+Ja5EVNBqHqF6rNsPjlRanVcR8Pwt7IjxiMhrFc ShMgCdsla6Haifsc5nSlz0z2L61JCFwIQtZpdZ1NPHl9BCu2/dJjuTbIi4vJTGGfflwW 4hPhp8TzeiuyGqZGX//z4YEjT2v1vHQ+mta6V8Cb9iWfOhtVWD0NJXCU06rWp0+69IoP VgFw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a170902c94500b0019f7977c9cfsi2076012pla.319.2023.04.06.09.08.02; Thu, 06 Apr 2023 09:08:23 -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 S239935AbjDFQH1 (ORCPT + 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 ); 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 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 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: 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 udmabuf for the locking policy update. Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- 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; -- 2.39.2