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

Lorenzo Bianconi lorenzo at kernel.org
Wed Oct 8 06:19:27 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,

Hi Simon,

> 
> 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.

right, I will fix it in v2.

Regards,
Lorenzo

> 
> > +
> >  	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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20251008/19ef0fab/attachment.sig>


More information about the linux-arm-kernel mailing list