Commit 7a13f8f5 authored by Francesco Virlinzi's avatar Francesco Virlinzi Committed by David S. Miller

stmmac: request_irq when use an ext wake irq line (v2)

In case of we use an external Wake-Up IRQ line
(priv->wol_irq != dev->irq) we need to invoke the
request_irq.
Signed-off-by: default avatarFrancesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1cc5a735
...@@ -1047,6 +1047,17 @@ static int stmmac_open(struct net_device *dev) ...@@ -1047,6 +1047,17 @@ static int stmmac_open(struct net_device *dev)
goto open_error; goto open_error;
} }
/* Request the Wake IRQ in case of another line is used for WoL */
if (priv->wol_irq != dev->irq) {
ret = request_irq(priv->wol_irq, stmmac_interrupt,
IRQF_SHARED, dev->name, dev);
if (unlikely(ret < 0)) {
pr_err("%s: ERROR: allocating the ext WoL IRQ %d "
"(error: %d)\n", __func__, priv->wol_irq, ret);
goto open_error_wolirq;
}
}
/* Enable the MAC Rx/Tx */ /* Enable the MAC Rx/Tx */
stmmac_set_mac(priv->ioaddr, true); stmmac_set_mac(priv->ioaddr, true);
...@@ -1087,6 +1098,9 @@ static int stmmac_open(struct net_device *dev) ...@@ -1087,6 +1098,9 @@ static int stmmac_open(struct net_device *dev)
return 0; return 0;
open_error_wolirq:
free_irq(dev->irq, dev);
open_error: open_error:
#ifdef CONFIG_STMMAC_TIMER #ifdef CONFIG_STMMAC_TIMER
kfree(priv->tm); kfree(priv->tm);
...@@ -1127,6 +1141,8 @@ static int stmmac_release(struct net_device *dev) ...@@ -1127,6 +1141,8 @@ static int stmmac_release(struct net_device *dev)
/* Free the IRQ lines */ /* Free the IRQ lines */
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if (priv->wol_irq != dev->irq)
free_irq(priv->wol_irq, dev);
/* Stop TX/RX DMA and clear the descriptors */ /* Stop TX/RX DMA and clear the descriptors */
priv->hw->dma->stop_tx(priv->ioaddr); priv->hw->dma->stop_tx(priv->ioaddr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment