SKB_DROP_REASON_IP_INHDR);
--- a/include/linux/types.h
+++ b/include/linux/types.h
-@@ -244,5 +244,11 @@ typedef void (*swap_func_t)(void *a, voi
+@@ -245,5 +245,11 @@ typedef void (*swap_func_t)(void *a, voi
typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv);
typedef int (*cmp_func_t)(const void *a, const void *b);
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
-@@ -109,7 +109,7 @@ void notify_cpu_starting(unsigned int cp
+@@ -111,7 +111,7 @@ void notify_cpu_starting(unsigned int cp
extern void cpu_maps_update_begin(void);
extern void cpu_maps_update_done(void);
int bringup_hibernate_cpu(unsigned int sleep_cpu);
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -4569,6 +4569,9 @@ static inline void netif_addr_unlock_bh(
+@@ -4580,6 +4580,9 @@ static inline void netif_addr_unlock_bh(
void ether_setup(struct net_device *dev);
ring->dma, ring->phys);
ring->dma = NULL;
}
-@@ -3124,7 +3124,7 @@ static void mtk_dma_free(struct mtk_eth
- netdev_reset_queue(eth->netdev[i]);
+@@ -3132,7 +3132,7 @@ static void mtk_dma_free(struct mtk_eth
+
if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) {
dma_free_coherent(eth->dma_dev,
- MTK_QDMA_RING_SIZE * soc->txrx.txd_size,
eth->scratch_ring, eth->phy_scratch_ring);
eth->scratch_ring = NULL;
eth->phy_scratch_ring = 0;
-@@ -3174,7 +3174,7 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -3182,7 +3182,7 @@ static irqreturn_t mtk_handle_irq_rx(int
eth->rx_events++;
if (likely(napi_schedule_prep(ð->rx_napi))) {
__napi_schedule(ð->rx_napi);
}
-@@ -3200,9 +3200,9 @@ static irqreturn_t mtk_handle_irq(int ir
+@@ -3208,9 +3208,9 @@ static irqreturn_t mtk_handle_irq(int ir
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
if (mtk_r32(eth, reg_map->pdma.irq_mask) &
mtk_handle_irq_rx(irq, _eth);
}
if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) {
-@@ -3220,10 +3220,10 @@ static void mtk_poll_controller(struct n
+@@ -3228,10 +3228,10 @@ static void mtk_poll_controller(struct n
struct mtk_eth *eth = mac->hw;
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
}
#endif
-@@ -3387,7 +3387,7 @@ static int mtk_open(struct net_device *d
+@@ -3395,7 +3395,7 @@ static int mtk_open(struct net_device *d
napi_enable(ð->tx_napi);
napi_enable(ð->rx_napi);
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
refcount_set(ð->dma_refcnt, 1);
}
else
-@@ -3471,7 +3471,7 @@ static int mtk_stop(struct net_device *d
+@@ -3479,7 +3479,7 @@ static int mtk_stop(struct net_device *d
mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
napi_disable(ð->tx_napi);
napi_disable(ð->rx_napi);
-@@ -3947,9 +3947,9 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3955,9 +3955,9 @@ static int mtk_hw_init(struct mtk_eth *e
/* FE int grouping */
mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp);
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
if (mtk_is_netsys_v3_or_greater(eth)) {
-@@ -5057,11 +5057,15 @@ static const struct mtk_soc_data mt2701_
+@@ -5065,11 +5065,15 @@ static const struct mtk_soc_data mt2701_
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.version = 1,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5077,11 +5081,15 @@ static const struct mtk_soc_data mt7621_
+@@ -5085,11 +5089,15 @@ static const struct mtk_soc_data mt7621_
.offload_version = 1,
.hash_offset = 2,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5099,11 +5107,15 @@ static const struct mtk_soc_data mt7622_
+@@ -5107,11 +5115,15 @@ static const struct mtk_soc_data mt7622_
.hash_offset = 2,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5120,11 +5132,15 @@ static const struct mtk_soc_data mt7623_
+@@ -5128,11 +5140,15 @@ static const struct mtk_soc_data mt7623_
.hash_offset = 2,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
.disable_pll_modes = true,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5139,11 +5155,15 @@ static const struct mtk_soc_data mt7629_
+@@ -5147,11 +5163,15 @@ static const struct mtk_soc_data mt7629_
.required_pctl = false,
.has_accounting = true,
.version = 1,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5161,11 +5181,15 @@ static const struct mtk_soc_data mt7981_
+@@ -5169,11 +5189,15 @@ static const struct mtk_soc_data mt7981_
.hash_offset = 4,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
-@@ -5183,11 +5207,15 @@ static const struct mtk_soc_data mt7986_
+@@ -5191,11 +5215,15 @@ static const struct mtk_soc_data mt7986_
.hash_offset = 4,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
-@@ -5205,11 +5233,15 @@ static const struct mtk_soc_data mt7988_
+@@ -5213,11 +5241,15 @@ static const struct mtk_soc_data mt7988_
.hash_offset = 4,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V3_SIZE,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
-@@ -5222,11 +5254,15 @@ static const struct mtk_soc_data rt5350_
+@@ -5230,11 +5262,15 @@ static const struct mtk_soc_data rt5350_
.required_clks = MT7628_CLKS_BITMAP,
.required_pctl = false,
.version = 1,
rxd->rxd5 = 0;
rxd->rxd6 = 0;
rxd->rxd7 = 0;
-@@ -3893,7 +3893,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3901,7 +3901,7 @@ static int mtk_hw_init(struct mtk_eth *e
else
mtk_hw_reset(eth);
/* Set FE to PDMAv2 if necessary */
val = mtk_r32(eth, MTK_FE_GLO_MISC);
mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC);
-@@ -5187,11 +5187,11 @@ static const struct mtk_soc_data mt7981_
+@@ -5195,11 +5195,11 @@ static const struct mtk_soc_data mt7981_
.dma_len_offset = 8,
},
.rx = {
},
};
-@@ -5213,11 +5213,11 @@ static const struct mtk_soc_data mt7986_
+@@ -5221,11 +5221,11 @@ static const struct mtk_soc_data mt7986_
.dma_len_offset = 8,
},
.rx = {
}
ring->frag_size = mtk_max_frag_size(rx_data_len);
-@@ -3143,7 +3150,10 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3151,7 +3158,10 @@ static void mtk_dma_free(struct mtk_eth
mtk_rx_clean(eth, ð->rx_ring[i], false);
}
}
static bool mtk_hw_reset_check(struct mtk_eth *eth)
-@@ -5065,11 +5075,14 @@ static const struct mtk_soc_data mt2701_
+@@ -5073,11 +5083,14 @@ static const struct mtk_soc_data mt2701_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5089,11 +5102,14 @@ static const struct mtk_soc_data mt7621_
+@@ -5097,11 +5110,14 @@ static const struct mtk_soc_data mt7621_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5115,11 +5131,14 @@ static const struct mtk_soc_data mt7622_
+@@ -5123,11 +5139,14 @@ static const struct mtk_soc_data mt7622_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5140,11 +5159,14 @@ static const struct mtk_soc_data mt7623_
+@@ -5148,11 +5167,14 @@ static const struct mtk_soc_data mt7623_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5163,11 +5185,14 @@ static const struct mtk_soc_data mt7629_
+@@ -5171,11 +5193,14 @@ static const struct mtk_soc_data mt7629_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
-@@ -5189,6 +5214,8 @@ static const struct mtk_soc_data mt7981_
+@@ -5197,6 +5222,8 @@ static const struct mtk_soc_data mt7981_
.desc_size = sizeof(struct mtk_tx_dma_v2),
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
.rx = {
.desc_size = sizeof(struct mtk_rx_dma),
-@@ -5196,6 +5223,7 @@ static const struct mtk_soc_data mt7981_
+@@ -5204,6 +5231,7 @@ static const struct mtk_soc_data mt7981_
.dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
};
-@@ -5215,6 +5243,8 @@ static const struct mtk_soc_data mt7986_
+@@ -5223,6 +5251,8 @@ static const struct mtk_soc_data mt7986_
.desc_size = sizeof(struct mtk_tx_dma_v2),
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
.rx = {
.desc_size = sizeof(struct mtk_rx_dma),
-@@ -5222,6 +5252,7 @@ static const struct mtk_soc_data mt7986_
+@@ -5230,6 +5260,7 @@ static const struct mtk_soc_data mt7986_
.dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
};
-@@ -5241,6 +5272,8 @@ static const struct mtk_soc_data mt7988_
+@@ -5249,6 +5280,8 @@ static const struct mtk_soc_data mt7988_
.desc_size = sizeof(struct mtk_tx_dma_v2),
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
.rx = {
.desc_size = sizeof(struct mtk_rx_dma_v2),
-@@ -5248,6 +5281,7 @@ static const struct mtk_soc_data mt7988_
+@@ -5256,6 +5289,7 @@ static const struct mtk_soc_data mt7988_
.dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = 8,
},
};
-@@ -5262,6 +5296,7 @@ static const struct mtk_soc_data rt5350_
+@@ -5270,6 +5304,7 @@ static const struct mtk_soc_data rt5350_
.desc_size = sizeof(struct mtk_tx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
.rx = {
.desc_size = sizeof(struct mtk_rx_dma),
-@@ -5269,6 +5304,7 @@ static const struct mtk_soc_data rt5350_
+@@ -5277,6 +5312,7 @@ static const struct mtk_soc_data rt5350_
.dma_l4_valid = RX_DMA_L4_VALID_PDMA,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
skb_record_rx_queue(skb, 0);
napi_gro_receive(napi, skb);
-@@ -3280,37 +3291,27 @@ static int mtk_start_dma(struct mtk_eth
+@@ -3288,37 +3299,27 @@ static int mtk_start_dma(struct mtk_eth
return 0;
}
}
-@@ -3370,7 +3371,10 @@ static int mtk_open(struct net_device *d
+@@ -3378,7 +3379,10 @@ static int mtk_open(struct net_device *d
{
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
if (err) {
-@@ -3394,18 +3398,38 @@ static int mtk_open(struct net_device *d
+@@ -3402,18 +3406,38 @@ static int mtk_open(struct net_device *d
for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
mtk_ppe_start(eth->ppe[i]);
phylink_start(mac->phylink);
netif_tx_start_all_queues(dev);
-@@ -3482,7 +3506,8 @@ static int mtk_stop(struct net_device *d
+@@ -3490,7 +3514,8 @@ static int mtk_stop(struct net_device *d
if (!refcount_dec_and_test(ð->dma_refcnt))
return 0;
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
mtk_rx_irq_disable(eth, eth->soc->rx.irq_done_mask);
-@@ -4977,23 +5002,24 @@ static int mtk_probe(struct platform_dev
+@@ -4985,23 +5010,24 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {
}
for (i = 0; i < MTK_MAX_DEVS; i++) {
-@@ -5096,6 +5122,7 @@ static const struct mtk_soc_data mt7621_
+@@ -5104,6 +5130,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false,
.version = 1,
.offload_version = 1,
.hash_offset = 2,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
.tx = {
-@@ -5124,6 +5151,7 @@ static const struct mtk_soc_data mt7622_
+@@ -5132,6 +5159,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false,
.version = 1,
.offload_version = 2,
.hash_offset = 2,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
-@@ -5152,6 +5180,7 @@ static const struct mtk_soc_data mt7623_
+@@ -5160,6 +5188,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true,
.version = 1,
.offload_version = 1,
.hash_offset = 2,
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
.disable_pll_modes = true,
-@@ -5207,6 +5236,7 @@ static const struct mtk_soc_data mt7981_
+@@ -5215,6 +5244,7 @@ static const struct mtk_soc_data mt7981_
.required_pctl = false,
.version = 2,
.offload_version = 2,
.hash_offset = 4,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
-@@ -5236,6 +5266,7 @@ static const struct mtk_soc_data mt7986_
+@@ -5244,6 +5274,7 @@ static const struct mtk_soc_data mt7986_
.required_pctl = false,
.version = 2,
.offload_version = 2,
.hash_offset = 4,
.has_accounting = true,
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
-@@ -5265,6 +5296,7 @@ static const struct mtk_soc_data mt7988_
+@@ -5273,6 +5304,7 @@ static const struct mtk_soc_data mt7988_
.required_pctl = false,
.version = 3,
.offload_version = 2,
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3400,7 +3400,7 @@ static int mtk_open(struct net_device *d
+@@ -3408,7 +3408,7 @@ static int mtk_open(struct net_device *d
for (i = 0; i < MTK_MAX_DEVS; i++) {
if (!eth->netdev[i])
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4482,6 +4482,20 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -4490,6 +4490,20 @@ static int mtk_set_rxnfc(struct net_devi
return ret;
}
static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
struct net_device *sb_dev)
{
-@@ -4510,8 +4524,10 @@ static const struct ethtool_ops mtk_etht
+@@ -4518,8 +4532,10 @@ static const struct ethtool_ops mtk_etht
.get_strings = mtk_get_strings,
.get_sset_count = mtk_get_sset_count,
.get_ethtool_stats = mtk_get_ethtool_stats,
mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK;
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
}
-@@ -4496,6 +4506,61 @@ static int mtk_set_pauseparam(struct net
+@@ -4504,6 +4514,61 @@ static int mtk_set_pauseparam(struct net
return phylink_ethtool_set_pauseparam(mac->phylink, pause);
}
static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
struct net_device *sb_dev)
{
-@@ -4528,6 +4593,8 @@ static const struct ethtool_ops mtk_etht
+@@ -4536,6 +4601,8 @@ static const struct ethtool_ops mtk_etht
.set_pauseparam = mtk_set_pauseparam,
.get_rxnfc = mtk_get_rxnfc,
.set_rxnfc = mtk_set_rxnfc,
};
static const struct net_device_ops mtk_netdev_ops = {
-@@ -4588,6 +4655,8 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4596,6 +4663,8 @@ static int mtk_add_mac(struct mtk_eth *e
}
mac = netdev_priv(eth->netdev[id]);
eth->mac[id] = mac;
-LINUX_VERSION-6.6 = .90
-LINUX_KERNEL_HASH-6.6.90 = ff856748671629c1fefef219099e0b4b81131c2d325e768cb0806e204157014e
+LINUX_VERSION-6.6 = .91
+LINUX_KERNEL_HASH-6.6.91 = d08d3d175407a52cd0b25fc95e149bbd2fd6922cd37816c8fcfad18f95e254f4
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -5125,6 +5125,8 @@ static int mtk_probe(struct platform_dev
+@@ -5133,6 +5133,8 @@ static int mtk_probe(struct platform_dev
* for NAPI to work
*/
init_dummy_netdev(ð->dummy_dev);
+++ /dev/null
-From 7d41a5a8e9c91cc6bb011dd953570738583dd091 Mon Sep 17 00:00:00 2001
-From: Daniel Golle <daniel@makrotopia.org>
-Date: Wed, 18 Sep 2024 02:01:01 +0100
-Subject: [PATCH] net: ethernet: mtk_eth_soc: reset all TX queues on DMA free
-
-The purpose of resetting the TX queue is to reset the
-byte and packet count as well as to clear the software
-flow control XOFF bit.
-
-MediaTek developers pointed out that netdev_reset_queue would only
-resets queue 0 of the network device.
-Queues that are not reset may cause unexpected issues.
-
-Packets may stop being sent after reset and "transmit timeout" log may
-be displayed.
-
-Import fix from MediaTek's SDK to resolve this issue.
-
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 ++++++++++++++----
- 1 file changed, 14 insertions(+), 4 deletions(-)
-
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3149,11 +3149,19 @@ static int mtk_dma_init(struct mtk_eth *
- static void mtk_dma_free(struct mtk_eth *eth)
- {
- const struct mtk_soc_data *soc = eth->soc;
-- int i;
-+ int i, j, txqs = 1;
-+
-+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
-+ txqs = MTK_QDMA_NUM_QUEUES;
-+
-+ for (i = 0; i < MTK_MAX_DEVS; i++) {
-+ if (!eth->netdev[i])
-+ continue;
-+
-+ for (j = 0; j < txqs; j++)
-+ netdev_tx_reset_queue(netdev_get_tx_queue(eth->netdev[i], j));
-+ }
-
-- for (i = 0; i < MTK_MAX_DEVS; i++)
-- if (eth->netdev[i])
-- netdev_reset_queue(eth->netdev[i]);
- if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) {
- dma_free_coherent(eth->dma_dev,
- MTK_QDMA_RING_SIZE * soc->tx.desc_size,