Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp489276rwb; Wed, 10 Aug 2022 11:32:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR7maG+iSCWtsV45vWkiFSdbu5NU8sJUnS2OBY9s163xO7jg9Ze/1KXQl6dbc9TQTMQrQUoi X-Received: by 2002:a05:6402:4143:b0:43b:206d:c283 with SMTP id x3-20020a056402414300b0043b206dc283mr27625686eda.381.1660156340216; Wed, 10 Aug 2022 11:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660156340; cv=none; d=google.com; s=arc-20160816; b=tRw2HD28VW3T6icrlZ4f/gxuKw1mqASvhx47bF1Mu6gSM9WoF/0G+lMIDd22T7OuUN s9bOLgESkL+HLxqApbN80HZCw120V3ktQjZ1diO5chrUr3fGGi0kkY0y2ch2eFwrvoyY Rkz3XX81nbwXxAUYweeEhlB9gUasUE5sZ9/n+XuxIjWxbBOv5Ab8ybEzSFMUYm+2bqvY B4qelMCnD4DggYsytX/EtOm/3FMut1h1o9iJfmm0Mv2wDgjGv2JL/xivEOHT4qfT6MsH Cwevcsqq/1lGZ/6v5wu6VKsfbcEkn9cpZcbxsVBgjXyJNc0D+64ZpRXuQX+iz4yar07x Bq/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2nzsHLQXmLrUkQKQkfpnoL8Wg8AIn8bQOQ/oMFoVcto=; b=QtoUdAIy7DYn2qTk81V1Ds9YB8f6F4RWClpaoEiXE2W1Nsxu1SF0Zbf0JMpciIbkDj OKCQevRNnNFeFZg6kHCbZ9v38HrtRN8dZL1Qf2J+eWpWTIf34/eNqMCQ4g0WatObF55D d41NOj+uogUheEDV/pzY0YfxFdGoNHoN1FiqVO6a+WliYrh/tW6AF6IuWlO0JxSq0PX1 eAuz6l0bpl0JZMiL41bI0oCdJ5lDoIXEyWCUzO+pdbwVXWqlozTcj9DUrlKcl9Kd2ghV HLeCKO6BDJkGGjb6FfkhsHwDN8UTuRa7u7bjJQQeq3OF7nGgHM3MHbkj/CZQwIw48uc7 LQag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Dx5zUXAv; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz15-20020a1709077d8f00b00730a229b07bsi5210600ejc.544.2022.08.10.11.31.54; Wed, 10 Aug 2022 11:32:20 -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=Dx5zUXAv; 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 S232561AbiHJRuD (ORCPT + 99 others); Wed, 10 Aug 2022 13:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiHJRuB (ORCPT ); Wed, 10 Aug 2022 13:50:01 -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 83B0C86C06; Wed, 10 Aug 2022 10:50:00 -0700 (PDT) Received: from [192.168.2.145] (unknown [109.252.119.13]) (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 D62E36601B74; Wed, 10 Aug 2022 18:49:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1660153798; bh=pDHN4Gq67YC5dkFkOigxG5qVuMpoiLudRbA2dlJSe60=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Dx5zUXAvOHpPG48aUabRl4+njgRCDMJzHPNbYmdwo/RrQaYohgnMXvlpCz6ESzyKs ngzi4Hf9SaHlQm+ddXoAVN+akYwgvtFkSA20LqsgtGm2i+fN5LnbRUM12j66sGvfut 405XDLhmATvxt75b00LbDt5bM7vhAV59hvardycmuItJ28RJJs57P9QBEwm4ARIJ4N Xr4LNfrsIBiE9revYn9VBAzA/V28mbhwQUOxsElunyWLFP9ZQpPw69GpUcbMWFAEk2 z8VCIqgHR6yyvRNwNJ57VkSQ1xch+gMPcB/ET5a4BOPLluJFgFU8esaLMJAfvVlpuY Juvao4qkUCZIQ== Message-ID: <562fbacf-3673-ff3c-23a1-124284b4456c@collabora.com> Date: Wed, 10 Aug 2022 20:49:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification Content-Language: en-US To: =?UTF-8?Q?Christian_K=c3=b6nig?= , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Osipenko , 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, spice-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20220725151839.31622-1-dmitry.osipenko@collabora.com> <20220725151839.31622-4-dmitry.osipenko@collabora.com> <6c8bded9-1809-608f-749a-5ee28b852d32@gmail.com> From: Dmitry Osipenko In-Reply-To: <6c8bded9-1809-608f-749a-5ee28b852d32@gmail.com> 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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/22 14:30, Christian König wrote: > Am 25.07.22 um 17:18 schrieb Dmitry Osipenko: >> This patch moves the non-dynamic dma-buf users over to the dynamic >> locking specification. The strict locking convention prevents deadlock >> situation for dma-buf importers and exporters. >> >> Previously the "unlocked" versions of the dma-buf API functions weren't >> taking the reservation lock and this patch makes them to take the lock. >> >> Intel and AMD GPU drivers already were mapping imported dma-bufs under >> the held lock, hence the "locked" variant of the functions are added >> for them and the drivers are updated to use the "locked" versions. > > In general "Yes, please", but that won't be that easy. > > You not only need to change amdgpu and i915, but all drivers > implementing the map_dma_buf(), unmap_dma_buf() callbacks. > > Auditing all that code is a huge bunch of work. Hm, neither of drivers take the resv lock in map_dma_buf/unmap_dma_buf. It's easy to audit them all and I did it. So either I'm missing something or it doesn't take much time to check them all. Am I really missing something? https://elixir.bootlin.com/linux/latest/A/ident/map_dma_buf -- Best regards, Dmitry