On 11/8/2025 9:26 AM, Sasha Levin wrote:
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 doorbellto the 6.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
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 stable@vger.kernel.org know about it.
commit 05587f91cc2e8b071605aeef6442d2acf6e627c9 Author: Mohammad Heib mheib@redhat.com 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. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Mohammad Heib <mheib@redhat.com> Link: https://patch.msgid.link/20251031155203.203031-1-mheib@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 0f5758c273c22..3a094d3ea6f4f 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -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