From: "Christian König" <christian.koenig@amd.com>
To: "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"David Airlie" <airlied@linux.ie>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Gurchetan Singh" <gurchetansingh@chromium.org>,
"Chia-I Wu" <olvaffe@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Gert Wollny" <gert.wollny@collabora.com>,
"Gustavo Padovan" <gustavo.padovan@collabora.com>,
"Daniel Stone" <daniel@fooishbar.org>,
"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Rob Clark" <robdclark@gmail.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Tomasz Figa" <tfiga@chromium.org>,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
"Thomas Hellström" <thomas_os@shipmail.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dmitry Osipenko <digetx@gmail.com>,
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
Subject: Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification
Date: Wed, 10 Aug 2022 20:25:08 +0200 [thread overview]
Message-ID: <87724722-b9f3-a016-c25c-4b0415f2c37f@amd.com> (raw)
In-Reply-To: <562fbacf-3673-ff3c-23a1-124284b4456c@collabora.com>
Am 10.08.22 um 19:49 schrieb Dmitry Osipenko:
> 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?
Ok, so this is only changing map/unmap now?
In this case please separate this from the documentation change.
I would also drop the _locked postfix from the function name, just
having _unlocked on all functions which are supposed to be called with
the lock held should be sufficient.
Thanks for looking into this,
Christian.
>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2FA%2Fident%2Fmap_dma_buf&data=05%7C01%7Cchristian.koenig%40amd.com%7C70fd52d0a82a477bfbfe08da7af8bec7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637957506041914442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K47uCULsoiURjze0H0ksUa4vzJ%2BxqgoShH9106FvyyA%3D&reserved=0
>
next prev parent reply other threads:[~2022-08-10 18:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 15:18 [PATCH v2 0/5] Move all drivers to a common dma-buf locking convention Dmitry Osipenko
2022-07-25 15:18 ` [PATCH v2 1/5] dma-buf: Add _unlocked postfix to function names Dmitry Osipenko
2022-08-09 11:56 ` [Linaro-mm-sig] " Christian König
2022-07-25 15:18 ` [PATCH v2 2/5] drm/gem: Take reservation lock for vmap/vunmap operations Dmitry Osipenko
2022-08-09 12:22 ` [Linaro-mm-sig] " Christian König
2022-07-25 15:18 ` [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification Dmitry Osipenko
2022-08-10 11:30 ` [Linaro-mm-sig] " Christian König
2022-08-10 17:49 ` Dmitry Osipenko
2022-08-10 18:25 ` Christian König [this message]
2022-08-10 18:53 ` Dmitry Osipenko
2022-08-12 11:34 ` Christian König
2022-08-12 11:46 ` Dmitry Osipenko
2022-08-10 17:51 ` Dmitry Osipenko
2022-07-25 15:18 ` [PATCH v2 4/5] media: videobuf2: Stop using internal dma-buf lock Dmitry Osipenko
2022-07-25 15:18 ` [PATCH v2 5/5] dma-buf: Remove internal lock Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87724722-b9f3-a016-c25c-4b0415f2c37f@amd.com \
--to=christian.koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=daniel.almeida@collabora.com \
--cc=daniel@ffwll.ch \
--cc=daniel@fooishbar.org \
--cc=digetx@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gert.wollny@collabora.com \
--cc=gurchetansingh@chromium.org \
--cc=gustavo.padovan@collabora.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kernel@collabora.com \
--cc=kraxel@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=robdclark@gmail.com \
--cc=rodrigo.vivi@intel.com \
--cc=spice-devel@lists.freedesktop.org \
--cc=sumit.semwal@linaro.org \
--cc=tfiga@chromium.org \
--cc=thierry.reding@gmail.com \
--cc=thomas_os@shipmail.org \
--cc=tomeu.vizoso@collabora.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).