diff mbox

[net] gianfar: Fix boot hangs while bringing up gianfar ethernet

Message ID 20090209193440.GA2537@ami.dom.local
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Jarek Poplawski Feb. 9, 2009, 7:34 p.m. UTC
On Mon, Feb 09, 2009 at 09:22:17AM -0800, Ira Snyder wrote:
...
> It works fine for me, the board now boots up normally.
> 
> Thanks for the patch,
> Ira

Very nice! Here is the same plus a comment. 

Many thanks,
Jarek P.

PS: Ira, your mta config is a bit unusual here wrt. reply; I hope you
will forgive me adding you to CC anyway.

PS#2: Andy, this changelog is really a lot harder than the patch...

------------------->
gianfar: Fix boot hangs while bringing up gianfar ethernet

Ira Snyder found that commit 8c7396aebb68994c0519e438eecdf4d5fa9c7844
"gianfar: Merge Tx and Rx interrupt for scheduling clean up ring" can
cause hangs. It's because there was removed clearing of interrupts in
gfar_schedule_cleanup() (which is called by an interrupt handler) in
case when netif scheduling has been disabled. This patch brings back
this action and a comment.

Reported-by: Ira Snyder <iws@ovro.caltech.edu>
Reported-by: Peter Korsgaard <jacmet@sunsite.dk>
Bisected-by: Ira Snyder <iws@ovro.caltech.edu>
Tested-by: Peter Korsgaard <jacmet@sunsite.dk>
Tested-by: Ira Snyder <iws@ovro.caltech.edu>
Signed-by: Jarek Poplawski <jarkao2@gmail.com>

---

 drivers/net/gianfar.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Feb. 9, 2009, 10:58 p.m. UTC | #1
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Mon, 9 Feb 2009 20:34:40 +0100

> gianfar: Fix boot hangs while bringing up gianfar ethernet
> 
> Ira Snyder found that commit 8c7396aebb68994c0519e438eecdf4d5fa9c7844
> "gianfar: Merge Tx and Rx interrupt for scheduling clean up ring" can
> cause hangs. It's because there was removed clearing of interrupts in
> gfar_schedule_cleanup() (which is called by an interrupt handler) in
> case when netif scheduling has been disabled. This patch brings back
> this action and a comment.
> 
> Reported-by: Ira Snyder <iws@ovro.caltech.edu>
> Reported-by: Peter Korsgaard <jacmet@sunsite.dk>
> Bisected-by: Ira Snyder <iws@ovro.caltech.edu>
> Tested-by: Peter Korsgaard <jacmet@sunsite.dk>
> Tested-by: Ira Snyder <iws@ovro.caltech.edu>
> Signed-by: Jarek Poplawski <jarkao2@gmail.com>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jarek Poplawski Feb. 10, 2009, 11:39 a.m. UTC | #2
On 09-02-2009 20:34, Jarek Poplawski wrote:
...
> PS: Ira, your mta config is a bit unusual here wrt. reply; I hope you
> will forgive me adding you to CC anyway.

FYI, AFAIR long time ago Ingo Molnar asked me to turn off this nice
feature called in mutt "followup_to". But, of course, if you find it
useful for you, then forget it.

Cheers,
Jarek P. 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index acae2d8..9b12a13 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1629,6 +1629,12 @@  static void gfar_schedule_cleanup(struct net_device *dev)
 	if (netif_rx_schedule_prep(&priv->napi)) {
 		gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED);
 		__netif_rx_schedule(&priv->napi);
+	} else {
+		/*
+		 * Clear IEVENT, so interrupts aren't called again
+		 * because of the packets that have already arrived.
+		 */
+		gfar_write(&priv->regs->ievent, IEVENT_RTX_MASK);
 	}
 
 	spin_unlock(&priv->rxlock);