mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@mailbox.org>
To: "Christian König" <christian.koenig@amd.com>,
	"Philipp Stanner" <phasta@kernel.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>,
	"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	"Shahyan Soltani" <shahyan.soltani@amd.com>,
	"Ruslan Vagner" <rusya92266@gmail.com>,
	"Mario Limonciello (AMD)" <superm1@kernel.org>,
	"Gustavo Padovan" <gustavo.padovan@collabora.com>,
	"Chris Wilson" <chris@chris-wilson.co.uk>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH v2 3/3] drm/amdgpu: Fix timestamp misordering
Date: Tue, 01 Dec 2026 15:18:54 +0100	[thread overview]
Message-ID: <8707fa1a4a42139cf0e0e1d6b7d02ace68c824d8.camel@mailbox.org> (raw)
In-Reply-To: <64705913-aeb2-40e0-9ebd-5a22da974ce8@amd.com>

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.

  reply	other threads:[~2026-12-01 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:17 [PATCH v2 0/3] dma-fence: Properly order timestamps Philipp Stanner
2026-12-01  9:17 ` [PATCH v2 1/3] dma-buf: dma-fence: Fix timestamp misordering Philipp Stanner
2026-12-01 10:57   ` Tvrtko Ursulin
2026-12-01 13:43   ` Christian König
2026-12-01  9:17 ` [PATCH v2 2/3] drm/sched: Prevent overwrite of non-existing timestamp Philipp Stanner
2026-12-01 14:09   ` Christian König
2026-12-01  9:17 ` [PATCH v2 3/3] drm/amdgpu: Fix timestamp misordering Philipp Stanner
2026-12-01 14:10   ` Christian König
2026-12-01 14:18     ` Philipp Stanner [this message]
2026-12-01 14:36 ` [PATCH v2 0/3] dma-fence: Properly order timestamps Danilo Krummrich

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=8707fa1a4a42139cf0e0e1d6b7d02ace68c824d8.camel@mailbox.org \
    --to=phasta@mailbox.org \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=phasta@kernel.org \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=rusya92266@gmail.com \
    --cc=shahyan.soltani@amd.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=superm1@kernel.org \
    --cc=tvrtko.ursulin@igalia.com \
    --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

all inboxes | Powered by JetHome®