All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	andi.shyti@linux.intel.com, krzysztof.karas@intel.com
Subject: Re: [PATCH] drm/i915: replace fetch_and_zero() with kernel xchg()
Date: Mon, 27 Apr 2026 15:26:13 +0300	[thread overview]
Message-ID: <7d18b591154516efd9be14c643bd576678b616bc@intel.com> (raw)
In-Reply-To: <75ba7e77fe28617f027ae49a620df8b580cd1000.1777291964.git.sebastian.brzezinka@intel.com>

On Mon, 27 Apr 2026, Sebastian Brzezinka <sebastian.brzezinka@intel.com> wrote:
> The i915 local fetch_and_zero() macro is a non-atomic
> fetch-and-zero operation defined in i915_utils.h and duplicated in
> display/intel_display_utils.h. Its functionality is equivalent to the
> kernel-provided xchg().

While I dislike having the local fetch_and_zero() macro around, the
usage does not need to be atomic, and there's no need to switch to the
atomic xchg() at all.

Using atomic xchg() gives the wrong impression to the reader that the
atomicity matters when it doesn't.

So that's a no for this patch.

There's been a few attempts at fixing this in the past, one I found was
[1].

[1] https://lore.kernel.org/r/20221209154843.4162814-1-andrzej.hajda@intel.com

> Replace fetch_and_zero() with the kernel provided xchg(), and
> remove the now unused macro definitions from both i915_utils.h and
> display/intel_display_utils.h.
>
> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>

Where did this happen? Was there a v1? Is this v2?

BR,
Jani.


-- 
Jani Nikula, Intel

  reply	other threads:[~2026-04-27 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 12:13 [PATCH] drm/i915: replace fetch_and_zero() with kernel xchg() Sebastian Brzezinka
2026-04-27 12:26 ` Jani Nikula [this message]
2026-04-27 12:37   ` Sebastian Brzezinka
2026-04-27 12:48     ` Jani Nikula
2026-04-27 12:51       ` Sebastian Brzezinka
2026-04-27 12:54         ` Jani Nikula
2026-04-28 14:47   ` Andi Shyti

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=7d18b591154516efd9be14c643bd576678b616bc@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=krzysztof.karas@intel.com \
    --cc=sebastian.brzezinka@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.