diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2013-12-10 19:40:43 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-10 18:01:10 -0500 |
commit | e9c56f8d2f851fb6d6ce6794c0f5463b862a878e (patch) | |
tree | 77106dde5b247fbc263c8dbf887f566879a9771e /drivers/net/ethernet | |
parent | 673498b8ed4c4d4b7221c5309d891c5eac2b7528 (diff) | |
download | linux-e9c56f8d2f851fb6d6ce6794c0f5463b862a878e.tar.gz linux-e9c56f8d2f851fb6d6ce6794c0f5463b862a878e.tar.xz |
net: allwinner: emac: Add missing free_irq
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/allwinner/sun4i-emac.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 50b853a79d77..46dfb1378c17 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -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 */ @@ -774,6 +773,8 @@ static int emac_stop(struct net_device *ndev) emac_shutdown(ndev); + free_irq(ndev->irq, ndev); + return 0; } |