Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'net-stmmac-xgmac-minor-fixes'

Rohan G Thomas says:

====================
net: stmmac: xgmac: Minor fixes

This patch series includes following minor fixes for stmmac
dwxgmac driver:

1. Disable Rx FIFO overflow interrupt for dwxgmac
2. Correct supported speed modes for dwxgmac
3. Check for coe-unsupported flag before setting CIC bit of
Tx Desc3 in the AF_XDP flow

v2: https://lore.kernel.org/20250816-xgmac-minor-fixes-v2-0-699552cf8a7f@altera.com
v1: https://lore.kernel.org/20250714-xgmac-minor-fixes-v1-0-c34092a88a72@altera.com
====================

Link: https://patch.msgid.link/20250825-xgmac-minor-fixes-v3-0-c225fe4444c0@altera.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+20 -8
+11 -2
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
··· 49 49 writel(XGMAC_INT_DEFAULT_EN, ioaddr + XGMAC_INT_EN); 50 50 } 51 51 52 + static void dwxgmac2_update_caps(struct stmmac_priv *priv) 53 + { 54 + if (!priv->dma_cap.mbps_10_100) 55 + priv->hw->link.caps &= ~(MAC_10 | MAC_100); 56 + else if (!priv->dma_cap.half_duplex) 57 + priv->hw->link.caps &= ~(MAC_10HD | MAC_100HD); 58 + } 59 + 52 60 static void dwxgmac2_set_mac(void __iomem *ioaddr, bool enable) 53 61 { 54 62 u32 tx = readl(ioaddr + XGMAC_TX_CONFIG); ··· 1432 1424 1433 1425 const struct stmmac_ops dwxgmac210_ops = { 1434 1426 .core_init = dwxgmac2_core_init, 1427 + .update_caps = dwxgmac2_update_caps, 1435 1428 .set_mac = dwxgmac2_set_mac, 1436 1429 .rx_ipc = dwxgmac2_rx_ipc, 1437 1430 .rx_queue_enable = dwxgmac2_rx_queue_enable, ··· 1541 1532 mac->mcast_bits_log2 = ilog2(mac->multicast_filter_bins); 1542 1533 1543 1534 mac->link.caps = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | 1544 - MAC_1000FD | MAC_2500FD | MAC_5000FD | 1545 - MAC_10000FD; 1535 + MAC_10 | MAC_100 | MAC_1000FD | 1536 + MAC_2500FD | MAC_5000FD | MAC_10000FD; 1546 1537 mac->link.duplex = 0; 1547 1538 mac->link.speed10 = XGMAC_CONFIG_SS_10_MII; 1548 1539 mac->link.speed100 = XGMAC_CONFIG_SS_100_MII;
+5 -4
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
··· 203 203 } 204 204 205 205 writel(value, ioaddr + XGMAC_MTL_RXQ_OPMODE(channel)); 206 - 207 - /* Enable MTL RX overflow */ 208 - value = readl(ioaddr + XGMAC_MTL_QINTEN(channel)); 209 - writel(value | XGMAC_RXOIE, ioaddr + XGMAC_MTL_QINTEN(channel)); 210 206 } 211 207 212 208 static void dwxgmac2_dma_tx_mode(struct stmmac_priv *priv, void __iomem *ioaddr, ··· 382 386 static int dwxgmac2_get_hw_feature(void __iomem *ioaddr, 383 387 struct dma_features *dma_cap) 384 388 { 389 + struct stmmac_priv *priv; 385 390 u32 hw_cap; 391 + 392 + priv = container_of(dma_cap, struct stmmac_priv, dma_cap); 386 393 387 394 /* MAC HW feature 0 */ 388 395 hw_cap = readl(ioaddr + XGMAC_HW_FEATURE0); ··· 409 410 dma_cap->vlhash = (hw_cap & XGMAC_HWFEAT_VLHASH) >> 4; 410 411 dma_cap->half_duplex = (hw_cap & XGMAC_HWFEAT_HDSEL) >> 3; 411 412 dma_cap->mbps_1000 = (hw_cap & XGMAC_HWFEAT_GMIISEL) >> 1; 413 + if (dma_cap->mbps_1000 && priv->synopsys_id >= DWXGMAC_CORE_2_20) 414 + dma_cap->mbps_10_100 = 1; 412 415 413 416 /* MAC HW feature 1 */ 414 417 hw_cap = readl(ioaddr + XGMAC_HW_FEATURE1);
+4 -2
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 2584 2584 struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue); 2585 2585 struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue]; 2586 2586 struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue]; 2587 + bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported; 2587 2588 struct xsk_buff_pool *pool = tx_q->xsk_pool; 2588 2589 unsigned int entry = tx_q->cur_tx; 2589 2590 struct dma_desc *tx_desc = NULL; ··· 2672 2671 } 2673 2672 2674 2673 stmmac_prepare_tx_desc(priv, tx_desc, 1, xdp_desc.len, 2675 - true, priv->mode, true, true, 2674 + csum, priv->mode, true, true, 2676 2675 xdp_desc.len); 2677 2676 2678 2677 stmmac_enable_dma_transmission(priv, priv->ioaddr, queue); ··· 4984 4983 { 4985 4984 struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue]; 4986 4985 struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue]; 4986 + bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported; 4987 4987 unsigned int entry = tx_q->cur_tx; 4988 4988 struct dma_desc *tx_desc; 4989 4989 dma_addr_t dma_addr; ··· 5036 5034 stmmac_set_desc_addr(priv, tx_desc, dma_addr); 5037 5035 5038 5036 stmmac_prepare_tx_desc(priv, tx_desc, 1, xdpf->len, 5039 - true, priv->mode, true, true, 5037 + csum, priv->mode, true, true, 5040 5038 xdpf->len); 5041 5039 5042 5040 tx_q->tx_count_frames++;