]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: ethernet: mtk_eth_soc: set DMA coherent mask to get PPE working
authorDaniel Golle <daniel@makrotopia.org>
Wed, 24 Jan 2024 16:22:09 +0000 (16:22 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Jan 2024 01:20:12 +0000 (17:20 -0800)
Set DMA coherent mask to 32-bit which makes PPE offloading engine start
working on BPi-R4 which got 4 GiB of RAM.

Fixes: 2d75891ebc09 ("net: ethernet: mtk_eth_soc: support 36-bit DMA addressing on MT7988")
Suggested-by: Elad Yifee <eladwf@users.github.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/97e90925368b405f0974b9b15f1b7377c4a329ad.1706113251.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index a6e91573f8dae8368f7667f5f5caa5636d881a60..de123350bd46b6e55ee5ea83737f79a4bceb6867 100644 (file)
@@ -4761,7 +4761,10 @@ static int mtk_probe(struct platform_device *pdev)
        }
 
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {
-               err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
+               err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36));
+               if (!err)
+                       err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+
                if (err) {
                        dev_err(&pdev->dev, "Wrong DMA config\n");
                        return -EINVAL;