* [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM
@ 2025-10-09 6:29 Lorenzo Bianconi
2025-10-09 8:54 ` Simon Horman
2025-10-12 17:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-10-09 6:29 UTC (permalink / raw)
To: Felix Fietkau, Sean Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, Lorenzo Bianconi, Sujuan Chen
Cc: netdev, linux-arm-kernel, linux-mediatek, Rex Lu, Daniel Pawlik,
Matteo Croce
From: Rex Lu <rex.lu@mediatek.com>
Limit tx/rx buffer address to 32-bit address space for board with more
than 4GB DRAM.
Fixes: 804775dfc2885 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Fixes: 6757d345dd7db ("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>
---
Changes in v2:
- Add missing Fixes tags
- Avoid possible deadlock if dma_set_mask_and_coherent fails
- Link to v1: https://lore.kernel.org/r/20251008-wed-4g-ram-limitation-v1-1-16fe55e1d042@kernel.org
---
drivers/net/ethernet/mediatek/mtk_wed.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 3dbb113b792cf00fb4f89ab20f7e7fa72ecac260..1ed1f88dd7f8bc69bf4cb2803b907c8d7776ae20 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -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);
---
base-commit: 07fdad3a93756b872da7b53647715c48d0f4a2d0
change-id: 20250930-wed-4g-ram-limitation-6490e7ed9d39
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM
2025-10-09 6:29 [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM Lorenzo Bianconi
@ 2025-10-09 8:54 ` Simon Horman
2025-10-12 17:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-10-09 8:54 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Felix Fietkau, Sean Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, Sujuan Chen, netdev, linux-arm-kernel,
linux-mediatek, Rex Lu, Daniel Pawlik, Matteo Croce
On Thu, Oct 09, 2025 at 08:29:34AM +0200, Lorenzo Bianconi wrote:
> From: Rex Lu <rex.lu@mediatek.com>
>
> Limit tx/rx buffer address to 32-bit address space for board with more
> than 4GB DRAM.
>
> Fixes: 804775dfc2885 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
> Fixes: 6757d345dd7db ("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>
> ---
> Changes in v2:
> - Add missing Fixes tags
> - Avoid possible deadlock if dma_set_mask_and_coherent fails
> - Link to v1: https://lore.kernel.org/r/20251008-wed-4g-ram-limitation-v1-1-16fe55e1d042@kernel.org
Thanks for the updates.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM
2025-10-09 6:29 [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM Lorenzo Bianconi
2025-10-09 8:54 ` Simon Horman
@ 2025-10-12 17:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-12 17:30 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: nbd, sean.wang, andrew+netdev, davem, edumazet, kuba, pabeni,
matthias.bgg, angelogioacchino.delregno, sujuan.chen, netdev,
linux-arm-kernel, linux-mediatek, rex.lu, pawlik.dan, teknoraver
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 09 Oct 2025 08:29:34 +0200 you wrote:
> From: Rex Lu <rex.lu@mediatek.com>
>
> Limit tx/rx buffer address to 32-bit address space for board with more
> than 4GB DRAM.
>
> Fixes: 804775dfc2885 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
> Fixes: 6757d345dd7db ("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>
>
> [...]
Here is the summary with links:
- [net,v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM
https://git.kernel.org/netdev/net/c/3abc0e55ea1f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-12 17:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 6:29 [PATCH net v2] net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM Lorenzo Bianconi
2025-10-09 8:54 ` Simon Horman
2025-10-12 17:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).