--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1075,10 +1075,13 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -1074,10 +1074,13 @@ static int mtk_init_fq_dma(struct mtk_et
dma_addr_t dma_addr;
int i;
if (unlikely(!eth->scratch_ring))
return -ENOMEM;
-@@ -2376,8 +2379,14 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2375,8 +2378,14 @@ static int mtk_tx_alloc(struct mtk_eth *
if (!ring->buf)
goto no_tx_mem;
if (!ring->dma)
goto no_tx_mem;
-@@ -2476,8 +2485,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2475,8 +2484,7 @@ static void mtk_tx_clean(struct mtk_eth
kfree(ring->buf);
ring->buf = NULL;
}
dma_free_coherent(eth->dma_dev,
ring->dma_size * soc->txrx.txd_size,
ring->dma, ring->phys);
-@@ -2496,9 +2504,14 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2495,9 +2503,14 @@ static int mtk_rx_alloc(struct mtk_eth *
{
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
struct mtk_rx_ring *ring;
if (rx_flag == MTK_RX_FLAGS_QDMA) {
if (ring_no)
return -EINVAL;
-@@ -2533,9 +2546,20 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2532,9 +2545,20 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->page_pool = pp;
}
if (!ring->dma)
return -ENOMEM;
-@@ -2618,7 +2642,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2617,7 +2641,7 @@ static int mtk_rx_alloc(struct mtk_eth *
return 0;
}
{
int i;
-@@ -2641,7 +2665,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2640,7 +2664,7 @@ static void mtk_rx_clean(struct mtk_eth
ring->data = NULL;
}
dma_free_coherent(eth->dma_dev,
ring->dma_size * eth->soc->txrx.rxd_size,
ring->dma, ring->phys);
-@@ -3001,7 +3025,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3003,7 +3027,7 @@ static void mtk_dma_free(struct mtk_eth
for (i = 0; i < MTK_MAX_DEVS; i++)
if (eth->netdev[i])
netdev_reset_queue(eth->netdev[i]);
dma_free_coherent(eth->dma_dev,
MTK_QDMA_RING_SIZE * soc->txrx.txd_size,
eth->scratch_ring, eth->phy_scratch_ring);
-@@ -3009,13 +3033,13 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3011,13 +3035,13 @@ static void mtk_dma_free(struct mtk_eth
eth->phy_scratch_ring = 0;
}
mtk_tx_clean(eth);
}
kfree(eth->scratch_head);
-@@ -4585,7 +4609,7 @@ static int mtk_sgmii_init(struct mtk_eth
+@@ -4587,7 +4611,7 @@ static int mtk_sgmii_init(struct mtk_eth
static int mtk_probe(struct platform_device *pdev)
{
struct device_node *mac_np;
struct mtk_eth *eth;
int err, i;
-@@ -4605,6 +4629,20 @@ static int mtk_probe(struct platform_dev
+@@ -4607,6 +4631,20 @@ static int mtk_probe(struct platform_dev
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
eth->ip_align = NET_IP_ALIGN;
spin_lock_init(ð->page_lock);
spin_lock_init(ð->tx_irq_lock);
spin_lock_init(ð->rx_irq_lock);
-@@ -4668,6 +4706,18 @@ static int mtk_probe(struct platform_dev
+@@ -4670,6 +4708,18 @@ static int mtk_probe(struct platform_dev
err = -EINVAL;
goto err_destroy_sgmii;
}