From: Philipp Stanner <phasta@mailbox.org>
To: phasta@kernel.org, Boris Brezillon <boris.brezillon@collabora.com>
Cc: "Sumit Semwal" <sumit.semwal@linaro.org>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Christian König" <christian.koenig@amd.com>,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Russell King" <linux+etnaviv@armlinux.org.uk>,
"Christian Gmeiner" <christian.gmeiner@gmail.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Frank Binns" <frank.binns@imgtec.com>,
"Matt Coster" <matt.coster@imgtec.com>,
"Qiang Yu" <yuq825@gmail.com>, "Rob Clark" <robdclark@gmail.com>,
"Sean Paul" <sean@poorly.run>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
"Marijn Suijten" <marijn.suijten@somainline.org>,
"Lyude Paul" <lyude@redhat.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Steven Price" <steven.price@arm.com>,
"Dave Airlie" <airlied@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Huang Rui" <ray.huang@amd.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Melissa Wen" <mwen@igalia.com>,
"Maíra Canal" <mcanal@igalia.com>,
"Zack Rusin" <zack.rusin@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
"Yang Wang" <kevinyang.wang@amd.com>,
"Jesse Zhang" <jesse.zhang@amd.com>,
"Tim Huang" <tim.huang@amd.com>,
"Sathishkumar S" <sathishkumar.sundararaju@amd.com>,
"Saleemkhan Jamadar" <saleemkhan.jamadar@amd.com>,
"Sunil Khatri" <sunil.khatri@amd.com>,
"Lijo Lazar" <lijo.lazar@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>,
"Ma Jun" <Jun.Ma2@amd.com>, "Yunxiang Li" <Yunxiang.Li@amd.com>,
"Eric Huang" <jinhuieric.huang@amd.com>,
"Asad Kamal" <asad.kamal@amd.com>,
"Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
"Jack Xiao" <Jack.Xiao@amd.com>,
"Friedrich Vock" <friedrich.vock@gmx.de>,
"Michel Dänzer" <mdaenzer@redhat.com>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, lima@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
nouveau@lists.freedesktop.org, virtualization@lists.linux.dev,
spice-devel@lists.freedesktop.org,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] dma-fence: Rename dma_fence_is_signaled()
Date: Wed, 09 Apr 2025 14:56:58 +0200 [thread overview]
Message-ID: <72eb974dfea8fa1167cf97e29848672223f6fc5b.camel@mailbox.org> (raw)
In-Reply-To: <73d41cd84c73b296789b654e45125bfce88e0dbf.camel@mailbox.org>
On Wed, 2025-04-09 at 14:51 +0200, Philipp Stanner wrote:
> On Wed, 2025-04-09 at 14:39 +0200, Boris Brezillon wrote:
> > Hi Philipp,
> >
> > On Wed, 9 Apr 2025 14:06:37 +0200
> > Philipp Stanner <phasta@kernel.org> wrote:
> >
> > > dma_fence_is_signaled()'s name strongly reads as if this function
> > > were
> > > intended for checking whether a fence is already signaled. Also
> > > the
> > > boolean it returns hints at that.
> > >
> > > The function's behavior, however, is more complex: it can check
> > > with a
> > > driver callback whether the hardware's sequence number indicates
> > > that
> > > the fence can already be treated as signaled, although the
> > > hardware's /
> > > driver's interrupt handler has not signaled it yet. If that's the
> > > case,
> > > the function also signals the fence.
> > >
> > > (Presumably) this has caused a bug in Nouveau (unknown commit),
> > > where
> > > nouveau_fence_done() uses the function to check a fence, which
> > > causes a
> > > race.
> > >
> > > Give the function a more obvious name.
> >
> > This is just my personal view on this, but I find the new name just
> > as
> > confusing as the old one. It sounds like something is checked, but
> > it's
> > clear what, and then the fence is forcibly signaled like it would
> > be
> > if
> > you call drm_fence_signal(). Of course, this clarified by the doc,
> > but
> > given the goal was to make the function name clearly reflect what
> > it
> > does, I'm not convinced it's significantly better.
> >
> > Maybe dma_fence_check_hw_state_and_propagate(), though it might be
> > too long of name. Oh well, feel free to ignore this comments if a
> > majority is fine with the new name.
>
> Yoa, the name isn't perfect (the perfect name describing the whole
> behavior would be
> dma_fence_check_if_already_signaled_then_check_hardware_state_and_pro
> pa
> gate() ^^'
>
> My intention here is to have the reader realize "watch out, the fence
> might get signaled here!", which is probably the most important event
> regarding fences, which can race, invoke the callbacks and so on.
>
> For details readers will then check the documentation.
>
> But I'm of course open to see if there's a majority for this or that
> name.
how about:
dma_fence_check_hw_and_signal() ?
P.
>
> P.
>
>
> >
> > Regards,
> >
> > Boris
>
next prev parent reply other threads:[~2025-04-14 17:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 12:06 [PATCH 0/2] dma-fence: Rename dma_fence_is_signaled() Philipp Stanner
2025-04-09 12:06 ` [PATCH 1/2] " Philipp Stanner
2025-04-09 12:39 ` Boris Brezillon
2025-04-09 12:51 ` Philipp Stanner
2025-04-09 12:56 ` Philipp Stanner [this message]
2025-04-09 13:14 ` Christian König
2025-04-09 14:01 ` Philipp Stanner
2025-04-09 14:10 ` Christian König
2025-04-09 15:04 ` Philipp Stanner
2025-04-10 8:37 ` Christian König
2025-04-09 12:06 ` [PATCH 2/2] dma-fence: Improve docu for dma_fence_check_and_signal() Philipp Stanner
2025-04-09 13:14 ` Li, Yunxiang (Teddy)
2025-04-09 13:05 ` ✗ CI.Patch_applied: failure for dma-fence: Rename dma_fence_is_signaled() Patchwork
2025-04-10 7:12 ` Patchwork
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=72eb974dfea8fa1167cf97e29848672223f6fc5b.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=Felix.Kuehling@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Jack.Xiao@amd.com \
--cc=Jun.Ma2@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=Yunxiang.Li@amd.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=anna-maria@linutronix.de \
--cc=asad.kamal@amd.com \
--cc=bas@basnieuwenhuizen.nl \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=boris.brezillon@collabora.com \
--cc=christian.gmeiner@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=frank.binns@imgtec.com \
--cc=frederic@kernel.org \
--cc=freedreno@lists.freedesktop.org \
--cc=friedrich.vock@gmx.de \
--cc=geert@linux-m68k.org \
--cc=gustavo@padovan.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jesse.zhang@amd.com \
--cc=jinhuieric.huang@amd.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kevinyang.wang@amd.com \
--cc=konradybcio@kernel.org \
--cc=kraxel@redhat.com \
--cc=l.stach@pengutronix.de \
--cc=lijo.lazar@amd.com \
--cc=lima@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=lyude@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=matt.coster@imgtec.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mcanal@igalia.com \
--cc=mdaenzer@redhat.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=nouveau@lists.freedesktop.org \
--cc=phasta@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=ray.huang@amd.com \
--cc=robdclark@gmail.com \
--cc=robh@kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=saleemkhan.jamadar@amd.com \
--cc=sathishkumar.sundararaju@amd.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=spice-devel@lists.freedesktop.org \
--cc=srinivasan.shanmugam@amd.com \
--cc=steven.price@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=sunil.khatri@amd.com \
--cc=tglx@linutronix.de \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tim.huang@amd.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux.dev \
--cc=yuq825@gmail.com \
--cc=zack.rusin@broadcom.com \
/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