linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: allwinner: emac: Add missing free_irq
@ 2013-12-10 18:40 Maxime Ripard
  2013-12-10 23:01 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Ripard @ 2013-12-10 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

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 at vger.kernel.org # 3.11+

---
Changes from v1:
  - Fixed the wrapping of request_irq

 drivers/net/ethernet/allwinner/sun4i-emac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 50b853a..46dfb13 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;
 }
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] net: allwinner: emac: Add missing free_irq
  2013-12-10 18:40 [PATCH v2] net: allwinner: emac: Add missing free_irq Maxime Ripard
@ 2013-12-10 23:01 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-12-10 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Tue, 10 Dec 2013 19:40:43 +0100

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-10 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 18:40 [PATCH v2] net: allwinner: emac: Add missing free_irq Maxime Ripard
2013-12-10 23:01 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).