mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 07:44:49 +01:00
net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM
Limit tx/rx buffer address to 32-bit address space for board with more than 4GB DRAM. Fixes:804775dfc2("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Fixes:6757d345dd("net: ethernet: mtk_wed: introduce hw_rro support for MT7988") Tested-by: Daniel Pawlik <pawlik.dan@gmail.com> Tested-by: Matteo Croce <teknoraver@meta.com> Signed-off-by: Rex Lu <rex.lu@mediatek.com> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d5d790ba15
commit
3abc0e55ea
1 changed files with 6 additions and 2 deletions
|
|
@ -677,7 +677,7 @@ mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev)
|
|||
void *buf;
|
||||
int s;
|
||||
|
||||
page = __dev_alloc_page(GFP_KERNEL);
|
||||
page = __dev_alloc_page(GFP_KERNEL | GFP_DMA32);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -800,7 +800,7 @@ mtk_wed_hwrro_buffer_alloc(struct mtk_wed_device *dev)
|
|||
struct page *page;
|
||||
int s;
|
||||
|
||||
page = __dev_alloc_page(GFP_KERNEL);
|
||||
page = __dev_alloc_page(GFP_KERNEL | GFP_DMA32);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -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)
|
||||
goto out;
|
||||
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue