All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	<intel-gfx@lists.freedesktop.org>
Cc: <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 14:37:55 +0200	[thread overview]
Message-ID: <DI3XYF0I8YPD.336A8XEBGNCDT@intel.com> (raw)
In-Reply-To: <7d18b591154516efd9be14c643bd576678b616bc@intel.com>

Hi Jani,

On Mon Apr 27, 2026 at 2:26 PM CEST, Jani Nikula wrote:
> 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
Thank you for the clarification. It’s good to know.

>> 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?
This patch was initially sent to trybot and received Review-by: Krzysztof
there. So I’ve copied it here.


-- 
Best regards,
Sebastian


  reply	other threads:[~2026-04-27 12:38 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
2026-04-27 12:37   ` Sebastian Brzezinka [this message]
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=DI3XYF0I8YPD.336A8XEBGNCDT@intel.com \
    --to=sebastian.brzezinka@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=krzysztof.karas@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.