Re: [PATCH v2 3/3] drm/amdgpu: Fix timestamp misordering
From: Philipp Stanner
Date: Tue Dec 01 2026 - 09:19:18 EST
On Tue, 2026-12-01 at 15:10 +0100, Christian König wrote:
> On 12/1/26 10:17, Philipp Stanner wrote:
> >
[…]
> >
> > /* When the fence is not even scheduled it can't have spend time */
> > s_fence = to_drm_sched_fence(fence);
> > - if (!test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &s_fence->scheduled.flags))
> > + if (!test_bit_acquire(DMA_FENCE_FLAG_TIMESTAMP_BIT, &s_fence->scheduled.flags))
>
> That one looks unnecessary to me because we don't really care about the timestamp value.
You do care, you read it at the end of the function. It's just that
coincidentally another memory barrier is in between which should do the
ordering.
I suggest we do this formally correct here.
Originally btw I wrote it like that because the entire code can be made
more readable with two helper variables. So this code here could then
use the new dma_fence_timestamp().
But ultimately your choice, since it's your user whose bypassing the
API here.
P.