Skip to content

Commit

Permalink
ravb: Add missing free_irq() calls to ravb_close()
Browse files Browse the repository at this point in the history
When reopening the network device on ra7795/salvator-x, e.g. after a
DHCP timeout:

    IP-Config: Reopening network devices...
    genirq: Flags mismatch irq 139. 00000000 (eth0:ch0:rx_be) vs. 00000000 (ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch0:rx_be
    IP-Config: Failed to open eth0
    IP-Config: No network devices available

The "mismatch" is due to requesting an IRQ that is already in use,
while IRQF_PROBE_SHARED wasn't set.

However, the real cause is that ravb_close() doesn't release any of the
R-Car Gen3-specific secondary IRQs.

Add the missing free_irq() calls to fix this.

Fixes: f51bdc2 ("ravb: Add dma queue interrupt support")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Acked-by: Sergei Shtylyov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
geertu authored and davem330 committed May 17, 2016
1 parent f82731b commit ccf9282
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,13 @@ static int ravb_close(struct net_device *ndev)
priv->phydev = NULL;
}

if (priv->chip_id == RCAR_GEN3)
if (priv->chip_id != RCAR_GEN2) {
free_irq(priv->tx_irqs[RAVB_NC], ndev);
free_irq(priv->rx_irqs[RAVB_NC], ndev);
free_irq(priv->tx_irqs[RAVB_BE], ndev);
free_irq(priv->rx_irqs[RAVB_BE], ndev);
free_irq(priv->emac_irq, ndev);
}
free_irq(ndev->irq, ndev);

napi_disable(&priv->napi[RAVB_NC]);
Expand Down

0 comments on commit ccf9282

Please sign in to comment.