Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-ravb-fix-soc-specific-configuration-and-descriptor-handling-issues'

Lad Prabhakar says:

====================
net: ravb: Fix SoC-specific configuration and descriptor handling issues [part]

This series addresses several issues in the Renesas Ethernet AVB (ravb)
driver related descriptor ordering.

A potential ordering hazard in descriptor setup could cause
the DMA engine to start prematurely, leading to TX stalls on some
platforms.

The series includes the following changes:

Enforce descriptor type ordering to prevent early DMA start
Ensure proper write ordering of TX descriptor type fields to prevent the
DMA engine from observing an incomplete descriptor chain. This fixes
observed TX stalls on RZ/G2L platforms running RT kernels.

Tested on R/G1x Gen2, RZ/G2x Gen3 and RZ/G2L family hardware.
====================

Link: https://patch.msgid.link/20251017151830.171062-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+22 -2
+22 -2
drivers/net/ethernet/renesas/ravb_main.c
··· 2211 2211 2212 2212 skb_tx_timestamp(skb); 2213 2213 } 2214 - /* Descriptor type must be set after all the above writes */ 2215 - dma_wmb(); 2214 + 2216 2215 if (num_tx_desc > 1) { 2217 2216 desc->die_dt = DT_FEND; 2218 2217 desc--; 2218 + /* When using multi-descriptors, DT_FEND needs to get written 2219 + * before DT_FSTART, but the compiler may reorder the memory 2220 + * writes in an attempt to optimize the code. 2221 + * Use a dma_wmb() barrier to make sure DT_FEND and DT_FSTART 2222 + * are written exactly in the order shown in the code. 2223 + * This is particularly important for cases where the DMA engine 2224 + * is already running when we are running this code. If the DMA 2225 + * sees DT_FSTART without the corresponding DT_FEND it will enter 2226 + * an error condition. 2227 + */ 2228 + dma_wmb(); 2219 2229 desc->die_dt = DT_FSTART; 2220 2230 } else { 2231 + /* Descriptor type must be set after all the above writes */ 2232 + dma_wmb(); 2221 2233 desc->die_dt = DT_FSINGLE; 2222 2234 } 2235 + 2236 + /* Before ringing the doorbell we need to make sure that the latest 2237 + * writes have been committed to memory, otherwise it could delay 2238 + * things until the doorbell is rang again. 2239 + * This is in replacement of the read operation mentioned in the HW 2240 + * manuals. 2241 + */ 2242 + dma_wmb(); 2223 2243 ravb_modify(ndev, TCCR, TCCR_TSRQ0 << q, TCCR_TSRQ0 << q); 2224 2244 2225 2245 priv->cur_tx[q] += num_tx_desc;