Skip to contentSkip to conversation

Patch "net: ionic: add dma_wmb() before ringing TX doorbell" has been added to the 6.12-stable tree

DISCUSSION Brett Creeley 1 participant 1 message Nov 10, 2025 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 47 lines · Sasha Levin

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

This is a note to let you know that I've just added the patch titled

net: ionic: add dma_wmb() before ringing TX doorbell

to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-ionic-add-dma_wmb-before-ringing-tx-doorbell.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

commit 05587f91cc2e8b071605aeef6442d2acf6e627c9

Author: Mohammad Heib <[email protected]>
Date:   Fri Oct 31 17:52:02 2025 +0200

net: ionic: add dma_wmb() before ringing TX doorbell

[ Upstream commit d261f5b09c28850dc63ca1d3018596f829f402d5 ]

The TX path currently writes descriptors and then immediately writes to the MMIO doorbell register to notify the NIC. On weakly ordered architectures, descriptor writes may still be pending in CPU or DMA write buffers when the doorbell is issued, leading to the device fetching stale or incomplete descriptors.

Add a dma_wmb() in ionic_txq_post() to ensure all descriptor writes are visible to the device before the doorbell MMIO write.

drivers/net/ethernet/pensando/ionic/ionic_txrx.c +0 -0
index 0f5758c273c22..3a094d3ea6f4f 100644

drivers/net/ethernet/pensando/ionic/ionic_txrx.c static void ionic_tx_clean(struct ionic_queue *q, · line 38

Quoted 10 lines
drivers/net/ethernet/pensando/ionic/ionic_txrx.c +4 -0
@@ -29,6 +29,10 @@ static void ionic_tx_clean(struct ionic_queue *q,
 
  static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell)
  {
+       /* Ensure TX descriptor writes reach memory before NIC reads them.
+        * Prevents device from fetching stale descriptors.
+        */
+       dma_wmb();
         ionic_q_post(q, ring_dbell);
  }
 

I posted on the original patch, but I will post here as well.

Apologies for the late and duplicate response, but it's not clear to me why this is necessary.

In other vendors the "doorbell record" (dbr) is writing another location in system memory, not an mmio write. These cases do use a dma_wmb().

Why isn't the writeq() sufficient in our case? According to Documentation/memory-barriers.txt it seems like writeq() should be sufficient.

Thanks,

Brett