generic: 6.1: refresh backport patches
[openwrt/staging/ldir.git] / target / linux / generic / backport-6.1 / 729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch
index cebb750bf64e394e5d67c669041e3a892edb118b..5fa2500a41edbbea21fd91b3cd082e37ce63364b 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  };
  
  /* strings used by ethtool */
-@@ -3283,6 +3289,102 @@ static void mtk_hw_warm_reset(struct mtk
+@@ -3337,6 +3343,102 @@ static void mtk_hw_warm_reset(struct mtk
                        val, rst_mask);
  }
  
@@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static int mtk_hw_init(struct mtk_eth *eth, bool reset)
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
-@@ -3615,6 +3717,7 @@ static int mtk_cleanup(struct mtk_eth *e
+@@ -3672,6 +3774,7 @@ static int mtk_cleanup(struct mtk_eth *e
        mtk_unreg_dev(eth);
        mtk_free_dev(eth);
        cancel_work_sync(&eth->pending_work);
@@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        return 0;
  }
-@@ -4042,6 +4145,7 @@ static int mtk_probe(struct platform_dev
+@@ -4099,6 +4202,7 @@ static int mtk_probe(struct platform_dev
  
        eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        INIT_WORK(&eth->rx_dim.work, mtk_dim_rx);
@@ -168,8 +168,8 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
-@@ -4246,6 +4350,8 @@ static int mtk_probe(struct platform_dev
-                      NAPI_POLL_WEIGHT);
+@@ -4301,6 +4405,8 @@ static int mtk_probe(struct platform_dev
+       netif_napi_add(&eth->dummy_dev, &eth->rx_napi, mtk_napi_rx);
  
        platform_set_drvdata(pdev, eth);
 +      schedule_delayed_work(&eth->reset.monitor_work,
@@ -179,7 +179,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -256,6 +256,8 @@
+@@ -257,6 +257,8 @@
  
  #define MTK_RX_DONE_INT_V2    BIT(14)
  
@@ -188,7 +188,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  /* QDMA Interrupt grouping registers */
  #define MTK_RLS_DONE_INT      BIT(0)
  
-@@ -538,6 +540,17 @@
+@@ -542,6 +544,17 @@
  #define MT7628_SDM_RBCNT      (MT7628_SDM_OFFSET + 0x10c)
  #define MT7628_SDM_CS_ERR     (MT7628_SDM_OFFSET + 0x110)
  
@@ -206,7 +206,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  struct mtk_rx_dma {
        unsigned int rxd1;
        unsigned int rxd2;
-@@ -934,6 +947,7 @@ struct mtk_reg_map {
+@@ -938,6 +951,7 @@ struct mtk_reg_map {
                u32     delay_irq;      /* delay interrupt */
                u32     irq_status;     /* interrupt status */
                u32     irq_mask;       /* interrupt mask */
@@ -214,8 +214,8 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                u32     int_grp;
        } pdma;
        struct {
-@@ -960,6 +974,8 @@ struct mtk_reg_map {
-       u32     gdma_to_ppe0;
+@@ -964,6 +978,8 @@ struct mtk_reg_map {
+       u32     gdma_to_ppe;
        u32     ppe_base;
        u32     wdma_base[2];
 +      u32     pse_iq_sta;
@@ -223,7 +223,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  };
  
  /* struct mtk_eth_data -      This is the structure holding all differences
-@@ -1002,6 +1018,8 @@ struct mtk_soc_data {
+@@ -1006,6 +1022,8 @@ struct mtk_soc_data {
        } txrx;
  };
  
@@ -232,7 +232,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  /* currently no SoC has more than 2 macs */
  #define MTK_MAX_DEVS                  2
  
-@@ -1124,6 +1142,14 @@ struct mtk_eth {
+@@ -1128,6 +1146,14 @@ struct mtk_eth {
        struct rhashtable               flow_table;
  
        struct bpf_prog                 __rcu *prog;