summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/faraday
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-04-05 05:28:48 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-06 22:38:04 +0300
commit81f1eca663c070ea07eb390ca2a0b205287c8fc1 (patch)
treeb34df8e0e0705162f03e837ec884d54fbf89cfba /drivers/net/ethernet/faraday
parentb8dbecff9bab8251d63bc7e7d0f6028f5afd7152 (diff)
downloadlinux-81f1eca663c070ea07eb390ca2a0b205287c8fc1.tar.xz
ftgmac100: Request the interrupt only after HW is reset
The interrupt isn't shared, so this will keep it masked until we have the HW in a known sane state. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday')
-rw-r--r--drivers/net/ethernet/faraday/ftgmac100.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index c8b4e6488545..09d06e2b78bd 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1131,12 +1131,6 @@ static int ftgmac100_open(struct net_device *netdev)
if (ftgmac100_alloc_rx_buffers(priv))
goto err_alloc;
- err = request_irq(netdev->irq, ftgmac100_interrupt, 0, netdev->name, netdev);
- if (err) {
- netdev_err(netdev, "failed to request irq %d\n", netdev->irq);
- goto err_irq;
- }
-
/* When using NC-SI we force the speed to 100Mbit/s full duplex,
*
* Otherwise we leave it set to 0 (no link), the link
@@ -1163,6 +1157,13 @@ static int ftgmac100_open(struct net_device *netdev)
/* Initialize NAPI */
netif_napi_add(netdev, &priv->napi, ftgmac100_poll, 64);
+ /* Grab our interrupt */
+ err = request_irq(netdev->irq, ftgmac100_interrupt, 0, netdev->name, netdev);
+ if (err) {
+ netdev_err(netdev, "failed to request irq %d\n", netdev->irq);
+ goto err_irq;
+ }
+
ftgmac100_init_hw(priv);
ftgmac100_start_hw(priv);
@@ -1193,12 +1194,12 @@ static int ftgmac100_open(struct net_device *netdev)
err_ncsi:
napi_disable(&priv->napi);
netif_stop_queue(netdev);
- netif_napi_del(&priv->napi);
- iowrite32(0, priv->base + FTGMAC100_OFFSET_IER);
-err_hw:
free_irq(netdev->irq, netdev);
err_irq:
+ netif_napi_del(&priv->napi);
+err_hw:
err_alloc:
+ iowrite32(0, priv->base + FTGMAC100_OFFSET_IER);
ftgmac100_free_buffers(priv);
ftgmac100_free_rings(priv);
return err;