[PATCH net] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM

Simon Horman horms at kernel.org
Wed Oct 8 05:37:31 PDT 2025


On Wed, Oct 08, 2025 at 12:48:05PM +0200, Lorenzo Bianconi wrote:
> From: Rex Lu <rex.lu at mediatek.com>
> 
> Limit tx/rx buffer address to 32-bit address space for board with more
> than 4GB DRAM.
> 

Hi Lorenzo, Rex, all,

As a fix for net a Fixes tag should probably go here.
> Tested-by: Daniel Pawlik <pawlik.dan at gmail.com>
> Tested-by: Matteo Croce <teknoraver at meta.com>
> Signed-off-by: Rex Lu <rex.lu at mediatek.com>
> Co-developed-by: Lorenzo Bianconi <lorenzo at kernel.org>
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>

...

> @@ -2426,6 +2426,10 @@ mtk_wed_attach(struct mtk_wed_device *dev)
>  	dev->version = hw->version;
>  	dev->hw->pcie_base = mtk_wed_get_pcie_base(dev);
>  
> +	ret = dma_set_mask_and_coherent(hw->dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		return ret;

I think 'goto out' is needed here to avoid leaking hw_lock.

> +
>  	if (hw->eth->dma_dev == hw->eth->dev &&
>  	    of_dma_is_coherent(hw->eth->dev->of_node))
>  		mtk_eth_set_dma_device(hw->eth, hw->dev);
> 

-- 
pw-bot: changes-requested



More information about the linux-arm-kernel mailing list