netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] stmmac: request_irq when use an ext wake irq line
@ 2012-02-09  7:55 Giuseppe CAVALLARO
  2012-02-09  7:55 ` [PATCH 2/2] stmmac: do not discard frame on dribbling bit assert Giuseppe CAVALLARO
  2012-02-09 19:02 ` [PATCH 1/2] stmmac: request_irq when use an ext wake irq line David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2012-02-09  7:55 UTC (permalink / raw)
  To: netdev; +Cc: Francesco Virlinzi, Giuseppe Cavallaro

From: Francesco Virlinzi <francesco.virlinzi@st.com>

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: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 96fa2da..36ee77f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1047,6 +1047,17 @@ static int stmmac_open(struct net_device *dev)
 		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 */
 	stmmac_set_mac(priv->ioaddr, true);
 
@@ -1087,6 +1098,9 @@ static int stmmac_open(struct net_device *dev)
 
 	return 0;
 
+open_error_wolirq:
+	free_irq(dev->irq, dev);
+
 open_error:
 #ifdef CONFIG_STMMAC_TIMER
 	kfree(priv->tm);
-- 
1.7.4.4

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

end of thread, other threads:[~2012-02-10  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09  7:55 [PATCH 1/2] stmmac: request_irq when use an ext wake irq line Giuseppe CAVALLARO
2012-02-09  7:55 ` [PATCH 2/2] stmmac: do not discard frame on dribbling bit assert Giuseppe CAVALLARO
2012-02-09 19:02 ` [PATCH 1/2] stmmac: request_irq when use an ext wake irq line David Miller
2012-02-10  6:31   ` Giuseppe CAVALLARO

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