1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Fri, 20 May 2022 20:11:26 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: rely on GFP_KERNEL for
4 dma_alloc_coherent whenever possible
6 Rely on GFP_KERNEL for dma descriptors mappings in mtk_tx_alloc(),
7 mtk_rx_alloc() and mtk_init_fq_dma() since they are run in non-irq
10 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
14 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
15 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
16 @@ -856,7 +856,7 @@ static int mtk_init_fq_dma(struct mtk_et
17 eth->scratch_ring = dma_alloc_coherent(eth->dma_dev,
18 cnt * sizeof(struct mtk_tx_dma),
19 ð->phy_scratch_ring,
22 if (unlikely(!eth->scratch_ring))
25 @@ -1634,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
28 ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
29 - &ring->phys, GFP_ATOMIC);
30 + &ring->phys, GFP_KERNEL);
34 @@ -1652,8 +1652,7 @@ static int mtk_tx_alloc(struct mtk_eth *
36 if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
37 ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
40 + &ring->phys_pdma, GFP_KERNEL);
44 @@ -1768,7 +1767,7 @@ static int mtk_rx_alloc(struct mtk_eth *
46 ring->dma = dma_alloc_coherent(eth->dma_dev,
47 rx_dma_size * sizeof(*ring->dma),
48 - &ring->phys, GFP_ATOMIC);
49 + &ring->phys, GFP_KERNEL);