diff options
| author | Serge Semin <fancer.lancer@gmail.com> | 2023-08-03 12:31:28 +0300 |
|---|---|---|
| committer | Serge Semin <fancer.lancer@gmail.com> | 2026-08-10 13:07:38 +0300 |
| commit | a6acac16114042842525d557726948a24793c681 (patch) | |
| tree | 442e5ef9f28b68627a93e7eaa0a59c55d463b190 | |
| parent | 0900e14d514cfb3a1543cb683add304d0599be99 (diff) | |
| download | linux-gmac/fix3.tar.gz linux-gmac/fix3.zip | |
net: stmmac: Fix freeing unused IRQ line if multi_msi_en is falsegmac/fix3
In case if the DW *MAC platform has DMA per-channel IRQs available,
specified and initialized in the STMMAC-resources structure but for some
reason the platform driver doesn't wish to use them, the stmmac_free_irq()
function will try to free those IRQs anyway. It will cause the kernel to
print backtrace and warn:
> WARNING: CPU: 1 PID: 1015 at kernel/irq/manage.c:1893 free_irq+0x104/0x468
> Trying to free already-free IRQ ...
Fix the stmmac_free_irq() method to freeing the DMA per-channel IRQs only
if the feature is explicitly enabled by means of the
plat_stmmacenet_data.multi_msi_en flag.
Fixes: 8532f613bc78 ("net: stmmac: introduce MSI Interrupt routines for mac, safety, RX & TX")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 02116b44a977..a58fac36896c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3745,7 +3745,7 @@ static void stmmac_free_irq(struct net_device *dev, switch (irq_err) { case REQ_IRQ_ERR_ALL: - irq_idx = priv->plat->tx_queues_to_use; + irq_idx = priv->plat->dma_cfg->multi_msi_en ? priv->plat->tx_queues_to_use : 0; fallthrough; case REQ_IRQ_ERR_TX: for (j = irq_idx - 1; j >= 0; j--) { @@ -3754,7 +3754,7 @@ static void stmmac_free_irq(struct net_device *dev, free_irq(priv->tx_irq[j], &priv->dma_conf.tx_queue[j]); } } - irq_idx = priv->plat->rx_queues_to_use; + irq_idx = priv->plat->dma_cfg->multi_msi_en ? priv->plat->rx_queues_to_use : 0; fallthrough; case REQ_IRQ_ERR_RX: for (j = irq_idx - 1; j >= 0; j--) { |
