[PATCH net v2] net: ethernet: mtk_eth_soc: fix SER panic with 4GB+ RAM

Jakub Kicinski kuba at kernel.org
Tue Apr 29 14:42:20 PDT 2025


On Sun, 27 Apr 2025 02:05:44 +0100 Daniel Golle wrote:
> +		if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {
> +			if (unlikely(dma_addr == DMA_MAPPING_ERROR))
> +				addr64 = FIELD_GET(RX_DMA_ADDR64_MASK,
> +						   rxd->rxd2);
> +			else
> +				addr64 = RX_DMA_PREP_ADDR64(dma_addr);

I guess it's correct but FWIW it reads slightly weird that in one
branch we use FIELD_GET() and in the other "PREP". I get that the
macros are a bit complicated but to the reader its not obvious whether
the value stored in addr64 is expected to be shifted or not 🤷️

> + rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size) | addr64; 



More information about the Linux-mediatek mailing list