From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B388EB64DD for ; Wed, 21 Jun 2023 18:16:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5119210E344; Wed, 21 Jun 2023 18:16:39 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C3EB10E344; Wed, 21 Jun 2023 18:16:37 +0000 (UTC) Received: from [192.168.2.254] (109-252-154-132.dynamic.spd-mgts.ru [109.252.154.132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 61D736606FAC; Wed, 21 Jun 2023 19:16:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687371394; bh=PQA2rc/Gs+XDzpOTYaQqwgwiDRANnpvkFuiUXn6B45A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=a6uFWwMGM2Wn9oqIqY7w7ZXRsmW9BSZjBsI4Ir5fTcMPux5toiFC6wlyILN77QVfb 0L+ZFaptUWmBOJZm2yvNv0eh15H4wUN+1EiHsUsv63mFz6hu/moMeG3T4oQV6i35F0 sHKIlQJA6GxprALI1nuPl+VQIhbWRMZVczzPnrUz21ntwNTap1H/IueLMyT7eRukEz N3GdhDZdinRaXuMBSFTeA1MUT7KUhYwb+koIItqlM5t/HFmZVenSeMDvjEPNqpSvPr WnQ/f7ngy10rNR4q+TxKWqOltsVMxB7/UwzmOPEST6X3Ell8COhkS5FvW3+wJ2ZV00 b/tPSDkrH1Jtg== Message-ID: <106bc72b-9358-de06-6f3f-06fdfa3859cd@collabora.com> Date: Wed, 21 Jun 2023 21:16:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 Content-Language: en-US To: "T.J. Mercier" References: <20230529223935.2672495-1-dmitry.osipenko@collabora.com> <20230529223935.2672495-3-dmitry.osipenko@collabora.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH v4 2/6] dma-buf/heaps: Don't assert held reservation lock for dma-buf mmapping X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, John Stultz , Gerd Hoffmann , kernel@collabora.com, Sumit Semwal , Marek Szyprowski , Benjamin Gaignard , linux-media@vger.kernel.org, Daniel Vetter , Arnd Bergmann , intel-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Mauro Carvalho Chehab , Tomi Valkeinen , linux-kernel@vger.kernel.org, Tomasz Figa , Thomas Zimmermann , =?UTF-8?Q?Christian_K=c3=b6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi, On 6/21/23 20:21, T.J. Mercier wrote: > On Mon, May 29, 2023 at 3:46 PM Dmitry Osipenko > wrote: >> >> 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 >> solved by moving the lock down to exporters. This patch prepares dma-buf >> heaps for the locking policy update. >> > Hi Dmitry, > > I see that in patch 6 of this series calls to > dma_resv_lock/dma_resv_unlock have been added to the > drm_gem_shmem_helper functions and some exporters. But I'm curious why > no dma_resv_lock/dma_resv_unlock calls were added to these two dma-buf > heap exporters for mmap? DMA-buf heaps are exporters, drm_gem_shmem_helper is importer. Locking rules are different for importers and exporters. DMA-heaps use own locking, they can be moved to resv lock in the future. DMA-heaps don't protect internal data in theirs mmap() implementations, nothing to protect there. -- Best regards, Dmitry