Skip to content

Commit e9ee910

Browse files
committed
Revert "net: stmmac: Enable Per DMA Channel interrupt"
Revert "net: stmmac: Use interrupt mode INTM=1 for per channel irq" This reverts commit 36af9f2. Revert "net: stmmac: Add support for TX/RX channel interrupt" This reverts commit 9072e03. Revert "net: stmmac: Make MSI interrupt routine generic" This reverts commit 477bd4b. Revert "dt-bindings: net: snps,dwmac: per channel irq" This reverts commit 67d47c8. 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>
1 parent 3ee29a4 commit e9ee910

9 files changed

Lines changed: 40 additions & 90 deletions

File tree

Documentation/devicetree/bindings/net/snps,dwmac.yaml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,17 @@ properties:
103103

104104
interrupts:
105105
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
107110

108111
interrupt-names:
109112
minItems: 1
110-
maxItems: 19
111113
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
127117

128118
clocks:
129119
minItems: 1

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ static int stmmac_config_single_msi(struct pci_dev *pdev,
952952

953953
res->irq = pci_irq_vector(pdev, 0);
954954
res->wol_irq = res->irq;
955-
plat->flags &= ~STMMAC_FLAG_MULTI_IRQ_EN;
955+
plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN;
956956
dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n",
957957
__func__);
958958

@@ -1004,7 +1004,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev,
10041004
if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX)
10051005
res->sfty_ue_irq = pci_irq_vector(pdev, plat->msi_sfty_ue_vec);
10061006

1007-
plat->flags |= STMMAC_FLAG_MULTI_IRQ_EN;
1007+
plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
10081008
dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__);
10091009

10101010
return 0;

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
427427
plat_dat->bsp_priv = dwmac;
428428
plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed;
429429

430-
if (stmmac_res.rx_irq[0] > 0 && stmmac_res.tx_irq[0] > 0)
431-
plat_dat->flags |= STMMAC_FLAG_MULTI_IRQ_EN;
432-
433430
ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
434431
if (ret)
435432
return ret;

drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static void dwmac4_dma_init(void __iomem *ioaddr,
175175

176176
value = readl(ioaddr + DMA_BUS_MODE);
177177

178-
if (dma_cfg->multi_irq_en) {
178+
if (dma_cfg->multi_msi_en) {
179179
value &= ~DMA_BUS_MODE_INTM_MASK;
180180
value |= (DMA_BUS_MODE_INTM_MODE1 << DMA_BUS_MODE_INTM_SHIFT);
181181
}

drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@
346346
/* DMA Registers */
347347
#define XGMAC_DMA_MODE 0x00003000
348348
#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
352349
#define XGMAC_DMA_SYSBUS_MODE 0x00003004
353350
#define XGMAC_WR_OSR_LMT GENMASK(29, 24)
354351
#define XGMAC_WR_OSR_LMT_SHIFT 24

drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ static void dwxgmac2_dma_init(void __iomem *ioaddr,
3131
value |= XGMAC_EAME;
3232

3333
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-
}
4134
}
4235

4336
static void dwxgmac2_dma_init_chan(struct stmmac_priv *priv,
@@ -372,18 +365,19 @@ static int dwxgmac2_dma_interrupt(struct stmmac_priv *priv,
372365
}
373366

374367
/* TX/RX NORMAL interrupts */
375-
if (likely(intr_status & XGMAC_RI)) {
376-
u64_stats_update_begin(&rxq_stats->syncp);
377-
rxq_stats->rx_normal_irq_n++;
378-
u64_stats_update_end(&rxq_stats->syncp);
379-
ret |= handle_rx;
380-
}
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;
368+
if (likely(intr_status & XGMAC_NIS)) {
369+
if (likely(intr_status & XGMAC_RI)) {
370+
u64_stats_update_begin(&rxq_stats->syncp);
371+
rxq_stats->rx_normal_irq_n++;
372+
u64_stats_update_end(&rxq_stats->syncp);
373+
ret |= handle_rx;
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;
380+
}
387381
}
388382

389383
/* Clear interrupts */

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id);
129129
/* For MSI interrupts handling */
130130
static irqreturn_t stmmac_mac_interrupt(int irq, void *dev_id);
131131
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);
134134
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue);
135135
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue);
136136
static void stmmac_reset_queues_param(struct stmmac_priv *priv);
@@ -3602,7 +3602,7 @@ static void stmmac_free_irq(struct net_device *dev,
36023602
}
36033603
}
36043604

3605-
static int stmmac_request_irq_multi(struct net_device *dev)
3605+
static int stmmac_request_irq_multi_msi(struct net_device *dev)
36063606
{
36073607
struct stmmac_priv *priv = netdev_priv(dev);
36083608
enum request_irq_err irq_err;
@@ -3697,7 +3697,7 @@ static int stmmac_request_irq_multi(struct net_device *dev)
36973697
}
36983698
}
36993699

3700-
/* Request Rx irq */
3700+
/* Request Rx MSI irq */
37013701
for (i = 0; i < priv->plat->rx_queues_to_use; i++) {
37023702
if (i >= MTL_MAX_RX_QUEUES)
37033703
break;
@@ -3707,11 +3707,11 @@ static int stmmac_request_irq_multi(struct net_device *dev)
37073707
int_name = priv->int_name_rx_irq[i];
37083708
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
37093709
ret = request_irq(priv->rx_irq[i],
3710-
stmmac_dma_rx_interrupt,
3710+
stmmac_msi_intr_rx,
37113711
0, int_name, &priv->dma_conf.rx_queue[i]);
37123712
if (unlikely(ret < 0)) {
37133713
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",
37153715
__func__, i, priv->rx_irq[i], ret);
37163716
irq_err = REQ_IRQ_ERR_RX;
37173717
irq_idx = i;
@@ -3722,7 +3722,7 @@ static int stmmac_request_irq_multi(struct net_device *dev)
37223722
irq_set_affinity_hint(priv->rx_irq[i], &cpu_mask);
37233723
}
37243724

3725-
/* Request Tx irq */
3725+
/* Request Tx MSI irq */
37263726
for (i = 0; i < priv->plat->tx_queues_to_use; i++) {
37273727
if (i >= MTL_MAX_TX_QUEUES)
37283728
break;
@@ -3732,11 +3732,11 @@ static int stmmac_request_irq_multi(struct net_device *dev)
37323732
int_name = priv->int_name_tx_irq[i];
37333733
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
37343734
ret = request_irq(priv->tx_irq[i],
3735-
stmmac_dma_tx_interrupt,
3735+
stmmac_msi_intr_tx,
37363736
0, int_name, &priv->dma_conf.tx_queue[i]);
37373737
if (unlikely(ret < 0)) {
37383738
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",
37403740
__func__, i, priv->tx_irq[i], ret);
37413741
irq_err = REQ_IRQ_ERR_TX;
37423742
irq_idx = i;
@@ -3811,8 +3811,8 @@ static int stmmac_request_irq(struct net_device *dev)
38113811
int ret;
38123812

38133813
/* 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);
38163816
else
38173817
ret = stmmac_request_irq_single(dev);
38183818

@@ -6075,7 +6075,7 @@ static irqreturn_t stmmac_safety_interrupt(int irq, void *dev_id)
60756075
return IRQ_HANDLED;
60766076
}
60776077

6078-
static irqreturn_t stmmac_dma_tx_interrupt(int irq, void *data)
6078+
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
60796079
{
60806080
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
60816081
struct stmmac_dma_conf *dma_conf;
@@ -6107,7 +6107,7 @@ static irqreturn_t stmmac_dma_tx_interrupt(int irq, void *data)
61076107
return IRQ_HANDLED;
61086108
}
61096109

6110-
static irqreturn_t stmmac_dma_rx_interrupt(int irq, void *data)
6110+
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
61116111
{
61126112
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
61136113
struct stmmac_dma_conf *dma_conf;
@@ -7456,8 +7456,8 @@ int stmmac_dvr_probe(struct device *device,
74567456
priv->plat = plat_dat;
74577457
priv->ioaddr = res->addr;
74587458
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);
74617461

74627462
priv->dev->irq = res->irq;
74637463
priv->wol_irq = res->wol_irq;

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,6 @@ EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
710710
int stmmac_get_platform_resources(struct platform_device *pdev,
711711
struct stmmac_resources *stmmac_res)
712712
{
713-
char irq_name[9];
714-
int i;
715-
int irq;
716-
717713
memset(stmmac_res, 0, sizeof(*stmmac_res));
718714

719715
/* Get IRQ information early to have an ability to ask for deferred
@@ -747,30 +743,6 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
747743
dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
748744
}
749745

750-
/* For RX Channel */
751-
for (i = 0; i < MTL_MAX_RX_QUEUES; i++) {
752-
snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i);
753-
irq = platform_get_irq_byname_optional(pdev, irq_name);
754-
if (irq == -EPROBE_DEFER)
755-
return irq;
756-
else if (irq < 0)
757-
break;
758-
759-
stmmac_res->rx_irq[i] = irq;
760-
}
761-
762-
/* For TX Channel */
763-
for (i = 0; i < MTL_MAX_TX_QUEUES; i++) {
764-
snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i);
765-
irq = platform_get_irq_byname_optional(pdev, irq_name);
766-
if (irq == -EPROBE_DEFER)
767-
return irq;
768-
else if (irq < 0)
769-
break;
770-
771-
stmmac_res->tx_irq[i] = irq;
772-
}
773-
774746
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
775747

776748
return PTR_ERR_OR_ZERO(stmmac_res->addr);

include/linux/stmmac.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct stmmac_dma_cfg {
9898
int mixed_burst;
9999
bool aal;
100100
bool eame;
101-
bool multi_irq_en;
101+
bool multi_msi_en;
102102
bool dche;
103103
};
104104

@@ -215,7 +215,7 @@ struct dwmac4_addrs {
215215
#define STMMAC_FLAG_TSO_EN BIT(4)
216216
#define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5)
217217
#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)
219219
#define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8)
220220
#define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9)
221221
#define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10)

0 commit comments

Comments
 (0)