uboot-sunxi: bump u-boot version - update u-boot to 2014.01-rc1 - smp support on a20
[openwrt/openwrt.git] / target / linux / sunxi / patches-3.12 / 200-emac-add-missing-free_irq.patch
1 From e9c56f8d2f851fb6d6ce6794c0f5463b862a878e Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime.ripard@free-electrons.com>
3 Date: Tue, 10 Dec 2013 19:40:43 +0100
4 Subject: [PATCH] net: allwinner: emac: Add missing free_irq
5
6 The sun4i-emac driver uses devm_request_irq at .ndo_open time, but relies on
7 the managed device mechanism to actually free it. This causes an issue whenever
8 someone wants to restart the interface, the interrupt still being held, and not
9 yet released.
10
11 Fall back to using the regular request_irq at .ndo_open time, and introduce a
12 free_irq during .ndo_stop.
13
14 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
15 Cc: stable@vger.kernel.org # 3.11+
16 Signed-off-by: David S. Miller <davem@davemloft.net>
17 ---
18 drivers/net/ethernet/allwinner/sun4i-emac.c | 5 +++--
19 1 file changed, 3 insertions(+), 2 deletions(-)
20
21 diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
22 index 50b853a..46dfb13 100644
23 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c
24 +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
25 @@ -717,8 +717,7 @@ static int emac_open(struct net_device *dev)
26 if (netif_msg_ifup(db))
27 dev_dbg(db->dev, "enabling %s\n", dev->name);
28
29 - if (devm_request_irq(db->dev, dev->irq, &emac_interrupt,
30 - 0, dev->name, dev))
31 + if (request_irq(dev->irq, &emac_interrupt, 0, dev->name, dev))
32 return -EAGAIN;
33
34 /* Initialize EMAC board */
35 @@ -774,6 +773,8 @@ static int emac_stop(struct net_device *ndev)
36
37 emac_shutdown(ndev);
38
39 + free_irq(ndev->irq, ndev);
40 +
41 return 0;
42 }
43
44 --
45 1.8.5.1
46