Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp257047imw; Fri, 15 Jul 2022 02:33:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOp/dRRYsUQIhUfgsXoRF4L5mR21rVIOAKE3bddRmv4eY5cD3SuG9bUhP3zgSGjQwzmIK+ X-Received: by 2002:a17:906:149:b0:711:fca6:bc2f with SMTP id 9-20020a170906014900b00711fca6bc2fmr12534147ejh.497.1657877621459; Fri, 15 Jul 2022 02:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657877621; cv=none; d=google.com; s=arc-20160816; b=GcIDpgGRShC0gG5EPR2kCTBrY8sPAFS/61RkEhOWRozVAPesiN2iMtty3ODOtPSnSW sV4dtVoMAO+iKQFbfol1NSuKKKfyNe7JSA9ky76KmCy+9t3L5swP6Xs1EvgbZvpH86/u 3DgPEXjJ3sUkAuULG9v84pLe2bjwwRjX23btqiXULjCLgmqcAJektn+cgAkEoiOi+sEC ojoa+vC1XRuDIE284sniWkYabqmalokZ+v1azNM12WQhiI+A3dS/AQWdsXIyYCwMP52y 9fwyK2hjfIwv4mwtiIM0Dt3VdgL2aYS5eUTht1mFc5A8aCNoXd5jGBgZqgboz59Wwpnd DEqw== 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=J0j37vR+RGwqY3Y3Lf7u3DB1DeTbpiHl4b89VaRgLKY=; b=wBmMCEgxjMODl6E3RMYDO5HNVbKJf/zO1u0jS0+W+uw0/b2MB2P2pWchmQzrEu/4GD GRS9Z4j6fgHmDEukIjCFNsMTOYhT54+AN7yGK8Xs5wvIGHvclnmaxm0Zye+6Ag1qAxB6 t8RjK5WjO0g/jnlcGcg9mXlVajcfj30MKjvu64WyEONQ4iqaLlYq1y1OQCuiIH0xoTrD Ekv9MCqdcNcB68J7bEhMuk0HVkLud4na4O7Qsl2vxwm0qcb4Nehzw5us7wa5om2JwIuj h/s2OxxJc/n114ZMgn+572detxwNEeL8bERA/zGey3LC4xEic2IyyfJiM1OrAyL/2nr+ FDjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ook7FofV; 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 cr18-20020a170906d55200b0072afb6d5ddcsi4168570ejc.741.2022.07.15.02.33.15; Fri, 15 Jul 2022 02:33:41 -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=ook7FofV; 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 S232356AbiGOJbr (ORCPT + 99 others); Fri, 15 Jul 2022 05:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231187AbiGOJbp (ORCPT ); Fri, 15 Jul 2022 05:31:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DEAE0B4; Fri, 15 Jul 2022 02:31:44 -0700 (PDT) Received: from [192.168.2.145] (109-252-119-232.nat.spd-mgts.ru [109.252.119.232]) (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 5E29866019A8; Fri, 15 Jul 2022 10:31:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657877502; bh=TWozmotf+sQwVdZNmn/06hy3nh6q5FZqNEZs2dkO0Xk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ook7FofVSeFu98kzfOW85/NvaqQGYfMlcoQwPYYEf1uM53lI6XEH5r2IfZA5D39YG One7B2e3W/fD6MOKVR32mTsfa0F578/RBAeOo8/NotqqijY2/uTpe7t/xwykgVmrPt +yavsYIuw7Eo6wCEeOig0kwF08jXCpcKDfKm5bf62mOtUtod68wxkNTfoOrBO2Vigr jGGe7rNPzl9ucoy/rbaMWflBdm9lL83CRfG8Nh3DuvKmTusiGl7vlEzXHo8BAnin4h VmXp2fNABeQZzflx/SPBJ4BlHwecx5t82vj5mWQ6sz+HwjJh2hV8TUmAiQ8RvCIpsC jI9dt2CUipsuA== Message-ID: <5c98385b-f154-0128-6f4b-5fac89529201@collabora.com> Date: Fri, 15 Jul 2022 12:31:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v1 1/6] dma-buf: Add _unlocked postfix to function names 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 , "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: <20220715005244.42198-1-dmitry.osipenko@collabora.com> <20220715005244.42198-2-dmitry.osipenko@collabora.com> <43c06f53-bad8-af99-0b57-781dbf716768@amd.com> From: Dmitry Osipenko In-Reply-To: <43c06f53-bad8-af99-0b57-781dbf716768@amd.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 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 7/15/22 10:19, Christian König wrote: >> -struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment >> *attach, >> -                    enum dma_data_direction direction) >> +struct sg_table * >> +dma_buf_map_attachment_unlocked(struct dma_buf_attachment *attach, >> +                enum dma_data_direction direction) > > The locking state of mapping and unmapping operations depend on if the > attachment is dynamic or not. > > So this here is not a good idea at all since it suggests that the > function is always called without holding the lock. I had the same thought while was working on this patch and initially was thinking about adding an "unlocked" alias to dma_buf_map_attachment(). In the end I decided that it will create even more confusion and it's simpler just to rename this func here since there are only two drivers using the dynamic mapping. Do you have suggestions how to improve it? -- Best regards, Dmitry