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

Revert "net: stmmac: Enable Per DMA Channel interrupt"

Revert "net: stmmac: Use interrupt mode INTM=1 for per channel irq"
This reverts commit 36af9f25ddfd311da82628f194c794786467cb12.
Revert "net: stmmac: Add support for TX/RX channel interrupt"
This reverts commit 9072e03d32088137a435ddf3aa95fd6e038d69d8.
Revert "net: stmmac: Make MSI interrupt routine generic"
This reverts commit 477bd4beb93bf9ace9bda71f1437b191befa9cf4.
Revert "dt-bindings: net: snps,dwmac: per channel irq"
This reverts commit 67d47c8ada0f8795bfcdb85cc8f2ad3ce556674b.

Device tree bindings need to be reviewed.

Link: https://lore.kernel.org/all/2df9fe3e-7971-4aa2-89a9-0e085b3b00d7@linaro.org/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+40 -90
+7 -17
Documentation/devicetree/bindings/net/snps,dwmac.yaml
··· 103 103 104 104 interrupts: 105 105 minItems: 1 106 - maxItems: 19 106 + items: 107 + - description: Combined signal for various interrupt events 108 + - description: The interrupt to manage the remote wake-up packet detection 109 + - description: The interrupt that occurs when Rx exits the LPI state 107 110 108 111 interrupt-names: 109 112 minItems: 1 110 - maxItems: 19 111 113 items: 112 - oneOf: 113 - - description: Combined signal for various interrupt events 114 - const: macirq 115 - - description: The interrupt to manage the remote wake-up packet detection 116 - const: eth_wake_irq 117 - - description: The interrupt that occurs when Rx exits the LPI state 118 - const: eth_lpi 119 - - description: DMA Tx per-channel interrupt 120 - pattern: '^dma_tx[0-7]?$' 121 - - description: DMA Rx per-channel interrupt 122 - pattern: '^dma_rx[0-7]?$' 123 - 124 - allOf: 125 - - contains: 126 - const: macirq 114 + - const: macirq 115 + - enum: [eth_wake_irq, eth_lpi] 116 + - const: eth_lpi 127 117 128 118 clocks: 129 119 minItems: 1
+2 -2
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
··· 952 952 953 953 res->irq = pci_irq_vector(pdev, 0); 954 954 res->wol_irq = res->irq; 955 - plat->flags &= ~STMMAC_FLAG_MULTI_IRQ_EN; 955 + plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN; 956 956 dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n", 957 957 __func__); 958 958 ··· 1004 1004 if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX) 1005 1005 res->sfty_ue_irq = pci_irq_vector(pdev, plat->msi_sfty_ue_vec); 1006 1006 1007 - plat->flags |= STMMAC_FLAG_MULTI_IRQ_EN; 1007 + plat->flags |= STMMAC_FLAG_MULTI_MSI_EN; 1008 1008 dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__); 1009 1009 1010 1010 return 0;
-3
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
··· 427 427 plat_dat->bsp_priv = dwmac; 428 428 plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed; 429 429 430 - if (stmmac_res.rx_irq[0] > 0 && stmmac_res.tx_irq[0] > 0) 431 - plat_dat->flags |= STMMAC_FLAG_MULTI_IRQ_EN; 432 - 433 430 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); 434 431 if (ret) 435 432 return ret;
+1 -1
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
··· 175 175 176 176 value = readl(ioaddr + DMA_BUS_MODE); 177 177 178 - if (dma_cfg->multi_irq_en) { 178 + if (dma_cfg->multi_msi_en) { 179 179 value &= ~DMA_BUS_MODE_INTM_MASK; 180 180 value |= (DMA_BUS_MODE_INTM_MODE1 << DMA_BUS_MODE_INTM_SHIFT); 181 181 }
-3
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
··· 346 346 /* DMA Registers */ 347 347 #define XGMAC_DMA_MODE 0x00003000 348 348 #define XGMAC_SWR BIT(0) 349 - #define XGMAC_DMA_MODE_INTM_MASK GENMASK(13, 12) 350 - #define XGMAC_DMA_MODE_INTM_SHIFT 12 351 - #define XGMAC_DMA_MODE_INTM_MODE1 0x1 352 349 #define XGMAC_DMA_SYSBUS_MODE 0x00003004 353 350 #define XGMAC_WR_OSR_LMT GENMASK(29, 24) 354 351 #define XGMAC_WR_OSR_LMT_SHIFT 24
+13 -19
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
··· 31 31 value |= XGMAC_EAME; 32 32 33 33 writel(value, ioaddr + XGMAC_DMA_SYSBUS_MODE); 34 - 35 - if (dma_cfg->multi_irq_en) { 36 - value = readl(ioaddr + XGMAC_DMA_MODE); 37 - value &= ~XGMAC_DMA_MODE_INTM_MASK; 38 - value |= (XGMAC_DMA_MODE_INTM_MODE1 << XGMAC_DMA_MODE_INTM_SHIFT); 39 - writel(value, ioaddr + XGMAC_DMA_MODE); 40 - } 41 34 } 42 35 43 36 static void dwxgmac2_dma_init_chan(struct stmmac_priv *priv, ··· 365 372 } 366 373 367 374 /* TX/RX NORMAL interrupts */ 368 - if (likely(intr_status & XGMAC_RI)) { 369 - u64_stats_update_begin(&rxq_stats->syncp); 370 - rxq_stats->rx_normal_irq_n++; 371 - u64_stats_update_end(&rxq_stats->syncp); 372 - ret |= handle_rx; 373 - } 374 - 375 - if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) { 376 - u64_stats_update_begin(&txq_stats->syncp); 377 - txq_stats->tx_normal_irq_n++; 378 - u64_stats_update_end(&txq_stats->syncp); 379 - ret |= handle_tx; 375 + if (likely(intr_status & XGMAC_NIS)) { 376 + if (likely(intr_status & XGMAC_RI)) { 377 + u64_stats_update_begin(&rxq_stats->syncp); 378 + rxq_stats->rx_normal_irq_n++; 379 + u64_stats_update_end(&rxq_stats->syncp); 380 + ret |= handle_rx; 381 + } 382 + if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) { 383 + u64_stats_update_begin(&txq_stats->syncp); 384 + txq_stats->tx_normal_irq_n++; 385 + u64_stats_update_end(&txq_stats->syncp); 386 + ret |= handle_tx; 387 + } 380 388 } 381 389 382 390 /* Clear interrupts */
+15 -15
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 129 129 /* For MSI interrupts handling */ 130 130 static irqreturn_t stmmac_mac_interrupt(int irq, void *dev_id); 131 131 static irqreturn_t stmmac_safety_interrupt(int irq, void *dev_id); 132 - static irqreturn_t stmmac_dma_tx_interrupt(int irq, void *data); 133 - static irqreturn_t stmmac_dma_rx_interrupt(int irq, void *data); 132 + static irqreturn_t stmmac_msi_intr_tx(int irq, void *data); 133 + static irqreturn_t stmmac_msi_intr_rx(int irq, void *data); 134 134 static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue); 135 135 static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue); 136 136 static void stmmac_reset_queues_param(struct stmmac_priv *priv); ··· 3602 3602 } 3603 3603 } 3604 3604 3605 - static int stmmac_request_irq_multi(struct net_device *dev) 3605 + static int stmmac_request_irq_multi_msi(struct net_device *dev) 3606 3606 { 3607 3607 struct stmmac_priv *priv = netdev_priv(dev); 3608 3608 enum request_irq_err irq_err; ··· 3697 3697 } 3698 3698 } 3699 3699 3700 - /* Request Rx irq */ 3700 + /* Request Rx MSI irq */ 3701 3701 for (i = 0; i < priv->plat->rx_queues_to_use; i++) { 3702 3702 if (i >= MTL_MAX_RX_QUEUES) 3703 3703 break; ··· 3707 3707 int_name = priv->int_name_rx_irq[i]; 3708 3708 sprintf(int_name, "%s:%s-%d", dev->name, "rx", i); 3709 3709 ret = request_irq(priv->rx_irq[i], 3710 - stmmac_dma_rx_interrupt, 3710 + stmmac_msi_intr_rx, 3711 3711 0, int_name, &priv->dma_conf.rx_queue[i]); 3712 3712 if (unlikely(ret < 0)) { 3713 3713 netdev_err(priv->dev, 3714 - "%s: alloc rx-%d dma rx_irq %d (error: %d)\n", 3714 + "%s: alloc rx-%d MSI %d (error: %d)\n", 3715 3715 __func__, i, priv->rx_irq[i], ret); 3716 3716 irq_err = REQ_IRQ_ERR_RX; 3717 3717 irq_idx = i; ··· 3722 3722 irq_set_affinity_hint(priv->rx_irq[i], &cpu_mask); 3723 3723 } 3724 3724 3725 - /* Request Tx irq */ 3725 + /* Request Tx MSI irq */ 3726 3726 for (i = 0; i < priv->plat->tx_queues_to_use; i++) { 3727 3727 if (i >= MTL_MAX_TX_QUEUES) 3728 3728 break; ··· 3732 3732 int_name = priv->int_name_tx_irq[i]; 3733 3733 sprintf(int_name, "%s:%s-%d", dev->name, "tx", i); 3734 3734 ret = request_irq(priv->tx_irq[i], 3735 - stmmac_dma_tx_interrupt, 3735 + stmmac_msi_intr_tx, 3736 3736 0, int_name, &priv->dma_conf.tx_queue[i]); 3737 3737 if (unlikely(ret < 0)) { 3738 3738 netdev_err(priv->dev, 3739 - "%s: alloc tx-%d dma tx_irq %d (error: %d)\n", 3739 + "%s: alloc tx-%d MSI %d (error: %d)\n", 3740 3740 __func__, i, priv->tx_irq[i], ret); 3741 3741 irq_err = REQ_IRQ_ERR_TX; 3742 3742 irq_idx = i; ··· 3811 3811 int ret; 3812 3812 3813 3813 /* Request the IRQ lines */ 3814 - if (priv->plat->flags & STMMAC_FLAG_MULTI_IRQ_EN) 3815 - ret = stmmac_request_irq_multi(dev); 3814 + if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) 3815 + ret = stmmac_request_irq_multi_msi(dev); 3816 3816 else 3817 3817 ret = stmmac_request_irq_single(dev); 3818 3818 ··· 6075 6075 return IRQ_HANDLED; 6076 6076 } 6077 6077 6078 - static irqreturn_t stmmac_dma_tx_interrupt(int irq, void *data) 6078 + static irqreturn_t stmmac_msi_intr_tx(int irq, void *data) 6079 6079 { 6080 6080 struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data; 6081 6081 struct stmmac_dma_conf *dma_conf; ··· 6107 6107 return IRQ_HANDLED; 6108 6108 } 6109 6109 6110 - static irqreturn_t stmmac_dma_rx_interrupt(int irq, void *data) 6110 + static irqreturn_t stmmac_msi_intr_rx(int irq, void *data) 6111 6111 { 6112 6112 struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data; 6113 6113 struct stmmac_dma_conf *dma_conf; ··· 7456 7456 priv->plat = plat_dat; 7457 7457 priv->ioaddr = res->addr; 7458 7458 priv->dev->base_addr = (unsigned long)res->addr; 7459 - priv->plat->dma_cfg->multi_irq_en = 7460 - (priv->plat->flags & STMMAC_FLAG_MULTI_IRQ_EN); 7459 + priv->plat->dma_cfg->multi_msi_en = 7460 + (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN); 7461 7461 7462 7462 priv->dev->irq = res->irq; 7463 7463 priv->wol_irq = res->wol_irq;
-28
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 710 710 int stmmac_get_platform_resources(struct platform_device *pdev, 711 711 struct stmmac_resources *stmmac_res) 712 712 { 713 - char irq_name[9]; 714 - int i; 715 - int irq; 716 - 717 713 memset(stmmac_res, 0, sizeof(*stmmac_res)); 718 714 719 715 /* Get IRQ information early to have an ability to ask for deferred ··· 741 745 if (stmmac_res->lpi_irq == -EPROBE_DEFER) 742 746 return -EPROBE_DEFER; 743 747 dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); 744 - } 745 - 746 - /* For RX Channel */ 747 - for (i = 0; i < MTL_MAX_RX_QUEUES; i++) { 748 - snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i); 749 - irq = platform_get_irq_byname_optional(pdev, irq_name); 750 - if (irq == -EPROBE_DEFER) 751 - return irq; 752 - else if (irq < 0) 753 - break; 754 - 755 - stmmac_res->rx_irq[i] = irq; 756 - } 757 - 758 - /* For TX Channel */ 759 - for (i = 0; i < MTL_MAX_TX_QUEUES; i++) { 760 - snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i); 761 - irq = platform_get_irq_byname_optional(pdev, irq_name); 762 - if (irq == -EPROBE_DEFER) 763 - return irq; 764 - else if (irq < 0) 765 - break; 766 - 767 - stmmac_res->tx_irq[i] = irq; 768 748 } 769 749 770 750 stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
+2 -2
include/linux/stmmac.h
··· 98 98 int mixed_burst; 99 99 bool aal; 100 100 bool eame; 101 - bool multi_irq_en; 101 + bool multi_msi_en; 102 102 bool dche; 103 103 }; 104 104 ··· 215 215 #define STMMAC_FLAG_TSO_EN BIT(4) 216 216 #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) 217 217 #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) 218 - #define STMMAC_FLAG_MULTI_IRQ_EN BIT(7) 218 + #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) 219 219 #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) 220 220 #define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) 221 221 #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10)