kernel: bump 5.10 to 5.10.124
[openwrt/openwrt.git] / target / linux / generic / pending-5.10 / 701-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
index 204f888d5112b502c4c14e5669cdd8290dad7166..3678530e9aa5d84b6651d6c7a7845a4308676002 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #include <linux/mfd/syscon.h>
  #include <linux/regmap.h>
  #include <linux/clk.h>
-@@ -821,7 +822,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -832,7 +833,7 @@ static int mtk_init_fq_dma(struct mtk_et
        dma_addr_t dma_addr;
        int i;
  
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                               cnt * sizeof(struct mtk_tx_dma),
                                               &eth->phy_scratch_ring,
                                               GFP_ATOMIC);
-@@ -833,10 +834,10 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -844,10 +845,10 @@ static int mtk_init_fq_dma(struct mtk_et
        if (unlikely(!eth->scratch_head))
                return -ENOMEM;
  
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                return -ENOMEM;
  
        phy_ring_tail = eth->phy_scratch_ring +
-@@ -890,26 +891,26 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -901,26 +902,26 @@ static void mtk_tx_unmap(struct mtk_eth
  {
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
                if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                       dma_unmap_addr(tx_buf, dma_addr1),
                                       dma_unmap_len(tx_buf, dma_len1),
                                       DMA_TO_DEVICE);
-@@ -987,9 +988,9 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -998,9 +999,9 @@ static int mtk_tx_map(struct sk_buff *sk
        if (skb_vlan_tag_present(skb))
                txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
  
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                return -ENOMEM;
  
        WRITE_ONCE(itxd->txd1, mapped_addr);
-@@ -1028,10 +1029,10 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1039,10 +1040,10 @@ static int mtk_tx_map(struct sk_buff *sk
  
  
                        frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                goto err_dma;
  
                        if (i == nr_frags - 1 &&
-@@ -1309,18 +1310,18 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1323,18 +1324,18 @@ static int mtk_poll_rx(struct napi_struc
                        netdev->stats.rx_dropped++;
                        goto release_desc;
                }
@@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                 ring->buf_size, DMA_FROM_DEVICE);
  
                /* receive data */
-@@ -1593,7 +1594,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1607,7 +1608,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        if (!ring->buf)
                goto no_tx_mem;
  
@@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                       &ring->phys, GFP_ATOMIC);
        if (!ring->dma)
                goto no_tx_mem;
-@@ -1611,7 +1612,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1625,7 +1626,7 @@ static int mtk_tx_alloc(struct mtk_eth *
         * descriptors in ring->dma_pdma.
         */
        if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                                    &ring->phys_pdma,
                                                    GFP_ATOMIC);
                if (!ring->dma_pdma)
-@@ -1670,7 +1671,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1684,7 +1685,7 @@ static void mtk_tx_clean(struct mtk_eth
        }
  
        if (ring->dma) {
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(*ring->dma),
                                  ring->dma,
                                  ring->phys);
-@@ -1678,7 +1679,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1692,7 +1693,7 @@ static void mtk_tx_clean(struct mtk_eth
        }
  
        if (ring->dma_pdma) {
@@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
                                  ring->dma_pdma,
                                  ring->phys_pdma);
-@@ -1723,18 +1724,18 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1740,18 +1741,18 @@ static int mtk_rx_alloc(struct mtk_eth *
                        return -ENOMEM;
        }
  
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        return -ENOMEM;
                ring->dma[i].rxd1 = (unsigned int)dma_addr;
  
-@@ -1770,7 +1771,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1787,7 +1788,7 @@ static void mtk_rx_clean(struct mtk_eth
                                continue;
                        if (!ring->dma[i].rxd1)
                                continue;
@@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                         ring->dma[i].rxd1,
                                         ring->buf_size,
                                         DMA_FROM_DEVICE);
-@@ -1781,7 +1782,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1798,7 +1799,7 @@ static void mtk_rx_clean(struct mtk_eth
        }
  
        if (ring->dma) {
@@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  ring->dma_size * sizeof(*ring->dma),
                                  ring->dma,
                                  ring->phys);
-@@ -2137,7 +2138,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2154,7 +2155,7 @@ static void mtk_dma_free(struct mtk_eth
                if (eth->netdev[i])
                        netdev_reset_queue(eth->netdev[i]);
        if (eth->scratch_ring) {
@@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
                                  eth->scratch_ring,
                                  eth->phy_scratch_ring);
-@@ -2485,6 +2486,8 @@ static void mtk_dim_tx(struct work_struc
+@@ -2502,6 +2503,8 @@ static void mtk_dim_tx(struct work_struc
  
  static int mtk_hw_init(struct mtk_eth *eth)
  {
@@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        int i, val, ret;
  
        if (test_and_set_bit(MTK_HW_INIT, &eth->state))
-@@ -2497,6 +2500,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2514,6 +2517,10 @@ static int mtk_hw_init(struct mtk_eth *e
        if (ret)
                goto err_disable_pm;
  
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
                ret = device_reset(eth->dev);
                if (ret) {
-@@ -3046,6 +3053,35 @@ free_netdev:
+@@ -3063,6 +3070,35 @@ free_netdev:
        return err;
  }
  
@@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static int mtk_probe(struct platform_device *pdev)
  {
        struct device_node *mac_np;
-@@ -3059,6 +3095,7 @@ static int mtk_probe(struct platform_dev
+@@ -3076,6 +3112,7 @@ static int mtk_probe(struct platform_dev
        eth->soc = of_device_get_match_data(&pdev->dev);
  
        eth->dev = &pdev->dev;
@@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        eth->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(eth->base))
                return PTR_ERR(eth->base);
-@@ -3107,6 +3144,16 @@ static int mtk_probe(struct platform_dev
+@@ -3124,6 +3161,16 @@ static int mtk_probe(struct platform_dev
                }
        }