diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2022-05-20 20:11:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-22 22:24:32 +0100 |
commit | 62dfb4cc444649b3f841ddb4f472a12ed6422714 (patch) | |
tree | 630c9095196baf7661a15dd859a18101a7522ca4 /drivers/net | |
parent | 4b139b75cc9590136ab5eb015ebfd84568543e8c (diff) | |
download | linux-62dfb4cc444649b3f841ddb4f472a12ed6422714.tar.bz2 |
net: ethernet: mtk_eth_soc: rely on GFP_KERNEL for dma_alloc_coherent whenever possible
Rely on GFP_KERNEL for dma descriptors mappings in mtk_tx_alloc(),
mtk_rx_alloc() and mtk_init_fq_dma() since they are run in non-irq
context.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_eth_soc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 16f131445d8b..ccd864c968b2 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -816,7 +816,7 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) eth->scratch_ring = dma_alloc_coherent(eth->dma_dev, cnt * sizeof(struct mtk_tx_dma), ð->phy_scratch_ring, - GFP_ATOMIC); + GFP_KERNEL); if (unlikely(!eth->scratch_ring)) return -ENOMEM; @@ -1591,7 +1591,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) goto no_tx_mem; ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz, - &ring->phys, GFP_ATOMIC); + &ring->phys, GFP_KERNEL); if (!ring->dma) goto no_tx_mem; @@ -1609,8 +1609,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) */ if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz, - &ring->phys_pdma, - GFP_ATOMIC); + &ring->phys_pdma, GFP_KERNEL); if (!ring->dma_pdma) goto no_tx_mem; @@ -1722,7 +1721,7 @@ static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag) ring->dma = dma_alloc_coherent(eth->dma_dev, rx_dma_size * sizeof(*ring->dma), - &ring->phys, GFP_ATOMIC); + &ring->phys, GFP_KERNEL); if (!ring->dma) return -ENOMEM; |