Re: [PATCH] sfc: Use acquire/release for irq_soft_enabled

From: Simon Horman

Date: Wed Jun 03 2026 - 08:17:49 EST


On Thu, May 28, 2026 at 05:28:38PM +0800, Gui-Dong Han wrote:
> irq_soft_enabled is a lockless gate for interrupt handlers. When clear,
> handlers must only acknowledge interrupts and must not touch channel state.
>
> Channel reallocation disables this gate, swaps and initializes channel
> pointers, frees old channels, and then enables the gate again. READ_ONCE()
> does not provide an acquire barrier, so an IRQ handler can observe the gate
> as enabled while still seeing stale channel pointers or channel state.
>
> Use release stores when updating the gate and acquire loads in interrupt
> handlers before touching channels. Keep the existing smp_wmb() after gate
> updates, preserving the current ordering with event queue start and stop.
>
> Add small helpers to document the ordering and avoid repeating barrier
> comments at every caller. Without the comments, checkpatch warns about
> memory barriers without comments.
>
> Fixes: d829118705f8 ("sfc: Rework IRQ enable/disable")
> Fixes: 8127d661e77f ("sfc: Add support for Solarflare SFC9100 family")
> Fixes: 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
> Fixes: 51b35a454efd ("sfc: skeleton EF100 PF driver")
> Fixes: 6e173d3b4af9 ("sfc: Copy shared files needed for Siena (part 1)")
> Signed-off-by: Gui-Dong Han <hanguidong02@xxxxxxxxx>
> ---
> drivers/net/ethernet/sfc/ef10.c | 4 ++--
> drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
> drivers/net/ethernet/sfc/efx_channels.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/efx.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/falcon.c | 2 +-
> drivers/net/ethernet/sfc/falcon/farch.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/net_driver.h | 12 ++++++++++++
> drivers/net/ethernet/sfc/net_driver.h | 12 ++++++++++++
> drivers/net/ethernet/sfc/siena/efx_channels.c | 4 ++--
> drivers/net/ethernet/sfc/siena/farch.c | 4 ++--
> drivers/net/ethernet/sfc/siena/net_driver.h | 12 ++++++++++++
> 11 files changed, 50 insertions(+), 14 deletions(-)

I'm not sure if it would be worth breaking this up, say on a per-driver
basis. My main thinking here is that it might assist in backporting.

But, OTOH, I wonder if this should be targeted at net-next without
the Fixes tag - can this manifest in an actual bug that effects users?

FTR, there is an Ai-generated review of this patch available on sashiko.dev.
However, I believe that all the issues flagged there are pre-existing and
can be examined in the context of possible follow-up. I do not believe they
should block progress of this patch.

Overall, this looks good to me.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>