All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: DelaySystem@tubot.lat
Cc: shyamsunderreddypadira@gmail.com, marusik.adamenko@gmail.com,
	error27@gmail.com, christian.gromm@microchip.com,
	parthiban.veerasooran@microchip.com,
	rajveer.chaudhari.linux@gmail.com, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH v3] staging: most: dim2: drop volatile from state counters
Date: Fri, 20 Nov 2026 08:15:06 +0100	[thread overview]
Message-ID: <2026112047-delicate-sheet-620f@gregkh> (raw)
In-Reply-To: <20261118-staging-dim2-atomic-v3-1-bc595e081fc8@tubot.lat>

On Wed, Nov 18, 2026 at 10:24:41AM -0800, Maximo Manriquez Lizarraga via B4 Relay wrote:
> From: Maximo Manriquez Lizarraga <DelaySystem@tubot.lat>
> 
> The request_counter/service_counter pair is shared between the AHB
> hard-IRQ handler and the threaded-IRQ service path, but every access
> already runs under dim_lock with local interrupts disabled:
> dim2_ahb_isr() holds it across dim_service_ahb_int_irq(),
> dim2_task_irq() across dim_service_channel(), and configure_channel()
> across the dim_init_*() calls that zero the counters. The spinlock
> provides both the mutual exclusion and the memory barriers, so the
> volatile qualifier adds nothing and wrongly suggests lockless
> cross-context sharing (see
> Documentation/process/volatile-considered-harmful.rst).
> 
> Converting to atomic_t is the wrong tool here: the service-side
> check-and-increment cannot be a single atomic step when done as
> separate atomic_read() calls, as Dan Carpenter pointed out on the
> atomic_t attempt, and a lockless scheme would still need dim_lock for
> the sibling channel state (level, indices, done-buffer count, MBO
> lists) anyway.
> 
> Drop the qualifier and document the actual protection in place. No
> functional change intended.
> 
> Compile-tested only (MOST=m, MOST_DIM2=m build clean); I don't have
> this hardware, so testing on real hardware would be appreciated.

I'll only take stuff like this if you can test it on real hardware,
sorry.

thanks,

gre gk-h

      reply	other threads:[~2026-11-20  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 18:24 [PATCH v3] staging: most: dim2: drop volatile from state counters Maximo Manriquez Lizarraga
2026-11-18 18:24 ` Maximo Manriquez Lizarraga via B4 Relay
2026-11-20  7:15 ` Greg KH [this message]

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=2026112047-delicate-sheet-620f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=DelaySystem@tubot.lat \
    --cc=christian.gromm@microchip.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marusik.adamenko@gmail.com \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=rajveer.chaudhari.linux@gmail.com \
    --cc=shyamsunderreddypadira@gmail.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.