mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] dma-resv: Define guards for context-less dma_resv locks
Date: Thu, 21 May 2026 10:36:47 +0200	[thread overview]
Message-ID: <d793568d-9611-4174-b9e9-c71ffec5ae93@amd.com> (raw)
In-Reply-To: <20260518161531.331cab2d@fedora>

On 5/18/26 16:15, Boris Brezillon wrote:
> On Mon, 18 May 2026 14:18:41 +0200
> Christian König <christian.koenig@amd.com> wrote:
> 
>> On 5/18/26 11:14, Boris Brezillon wrote:
>>> Hi Christian,
>>>
>>> On Mon, 18 May 2026 09:10:23 +0200
>>> Christian König <christian.koenig@amd.com> wrote:
>>>   
>>>> On 5/13/26 18:58, Boris Brezillon wrote:  
>>>>> When used without a context, dma_resv are no different from regular
>>>>> locks. Define guards so we can use the guard-syntactic sugars for
>>>>> explicit/implicit scoped locks.
>>>>>
>>>>> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>    
>>>>
>>>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>>>
>>>> How do you want to upstream it? My preference would be drm-misc-next, but I think I can live with a panthor specific branch as well.  
>>>
>>> Everything Panthor related goes through drm-misc-next, so drm-misc-next
>>> also has my preference ;-). But I'd like to wait for more feedback on
>>> the other drm patches, and there are a few things I need to address in
>>> the panthor patches anyway, so it's likely to take a couple more weeks
>>> for this series to hit the drm-misc tree, unless you have a good reason
>>> to fast-track this specific patch.  
>>
>> Well the DMA-buf code itself uses dma_resv_lock/unlock
> 
> There's no use in dma-resv.c that can be converted to guards. I gave
> dma-buf.c a try, but just like for panthor, I don't really like the fact
> it's halfway through (other locks still use manual locking), so I'd be
> tempted to convert everything at once for consistency. If you're fine
> with that, I can give this a try.

Well depends on what everything means. I would only convert dma-buf.c in one patch and nothing else.

>> and obviously has test cases for all the different variants.
> 
> Looks like the test cases all validate that dma_resv_lock(x, NULL)
> returns 0. If I were to convert those to guard(dma_resv)(), these checks
> would be gone. Is that okay with you?

Ah, good point. No we need to check the return value here.

So keep the test cases as they are, they basically make sure that we can actually use the guards when there is no ticket.

Thanks,
Christian.

  reply	other threads:[~2026-05-21  8:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 16:58 [PATCH 0/6] drm/panthor: Use guards Boris Brezillon
2026-05-13 16:58 ` [PATCH 1/6] drm/panthor: Driver-wide xxx_[un]lock -> [scoped_]guard replacement Boris Brezillon
2026-05-14 13:16   ` Steven Price
2026-05-14 17:09     ` Chia-I Wu
2026-05-18  8:43       ` Boris Brezillon
2026-05-20 15:26         ` Steven Price
2026-05-20 15:43           ` Boris Brezillon
2026-05-18  8:57     ` Boris Brezillon
2026-05-18 23:50       ` [Linaro-mm-sig] " Chia-I Wu
2026-05-13 16:58 ` [PATCH 2/6] dma-resv: Define guards for context-less dma_resv locks Boris Brezillon
2026-05-14 18:23   ` Chia-I Wu
2026-05-18  7:10   ` Christian König
2026-05-18  9:14     ` Boris Brezillon
2026-05-18 12:18       ` Christian König
2026-05-18 14:15         ` Boris Brezillon
2026-05-21  8:36           ` Christian König [this message]
2026-05-21  8:54             ` Boris Brezillon
2026-05-21  9:01               ` Boris Brezillon
2026-05-21 12:19                 ` Christian König
2026-05-21 12:14               ` Christian König
2026-05-20 15:26   ` Steven Price
2026-05-13 16:58 ` [PATCH 3/6] drm: Define a conditional guard for drm_dev_{enter,exit}() Boris Brezillon
2026-05-14 18:34   ` Chia-I Wu
2026-05-18  8:28     ` Boris Brezillon
2026-05-18  9:16       ` Christian König
2026-05-18  9:35         ` Boris Brezillon
2026-05-13 16:58 ` [PATCH 4/6] drm/panthor: Use guards for resv locking Boris Brezillon
2026-05-14 18:35   ` Chia-I Wu
2026-05-13 16:58 ` [PATCH 5/6] drm/panthor: Use the drm_dev_access guard Boris Brezillon
2026-05-14 18:36   ` Chia-I Wu
2026-05-13 16:58 ` [PATCH 6/6] drm/panthor: Add a new guard for our custom resume_and_get() PM helper Boris Brezillon
2026-05-14 18:39   ` Chia-I Wu

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=d793568d-9611-4174-b9e9-c71ffec5ae93@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /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

Powered by JetHome