Skip to content

Commit

Permalink
net: allwinner: emac: Add missing free_irq
Browse files Browse the repository at this point in the history
The sun4i-emac driver uses devm_request_irq at .ndo_open time, but relies on
the managed device mechanism to actually free it. This causes an issue whenever
someone wants to restart the interface, the interrupt still being held, and not
yet released.

Fall back to using the regular request_irq at .ndo_open time, and introduce a
free_irq during .ndo_stop.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: stable@vger.kernel.org # 3.11+
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Ripard authored and David S. Miller committed Dec 10, 2013
1 parent 673498b commit e9c56f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/allwinner/sun4i-emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,7 @@ static int emac_open(struct net_device *dev)
if (netif_msg_ifup(db))
dev_dbg(db->dev, "enabling %s\n", dev->name);

if (devm_request_irq(db->dev, dev->irq, &emac_interrupt,
0, dev->name, dev))
if (request_irq(dev->irq, &emac_interrupt, 0, dev->name, dev))
return -EAGAIN;

/* Initialize EMAC board */
Expand Down Expand Up @@ -774,6 +773,8 @@ static int emac_stop(struct net_device *ndev)

emac_shutdown(ndev);

free_irq(ndev->irq, ndev);

return 0;
}

Expand Down

0 comments on commit e9c56f8

Please sign in to comment.