lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6024ebb-4b3d-60c8-f0e7-006f994c9fae@amd.com>
Date:   Fri, 15 Jul 2022 13:04:21 +0200
From:   Christian König <christian.koenig@....com>
To:     Dmitry Osipenko <dmitry.osipenko@...labora.com>,
        David Airlie <airlied@...ux.ie>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Gurchetan Singh <gurchetansingh@...omium.org>,
        Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel@...ll.ch>,
        Daniel Almeida <daniel.almeida@...labora.com>,
        Gert Wollny <gert.wollny@...labora.com>,
        Gustavo Padovan <gustavo.padovan@...labora.com>,
        Daniel Stone <daniel@...ishbar.org>,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Rob Clark <robdclark@...il.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        Thierry Reding <thierry.reding@...il.com>,
        Tomasz Figa <tfiga@...omium.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Alex Deucher <alexander.deucher@....com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
        Thomas Hellström <thomas_os@...pmail.org>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Dmitry Osipenko <digetx@...il.com>,
        linux-media@...r.kernel.org, linaro-mm-sig@...ts.linaro.org,
        amd-gfx@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
        kernel@...labora.com, virtualization@...ts.linux-foundation.org,
        spice-devel@...ts.freedesktop.org, linux-rdma@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v1 1/6] dma-buf: Add _unlocked postfix to function names

Am 15.07.22 um 11:31 schrieb Dmitry Osipenko:
> 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?

Just keep it as it is. The ultimative goal is to switch all drivers over 
to the dynamic mapping or at least over to assume that the map/unmap 
callbacks are called with the lock held.

Regards,
Christian.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ