netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gianfar: Wait for both RX and TX to stop
@ 2010-04-18 23:13 Andy Fleming
  2010-04-19 21:08 ` Timur Tabi
  2010-04-20  4:44 ` Kumar Gala
  0 siblings, 2 replies; 14+ messages in thread
From: Andy Fleming @ 2010-04-18 23:13 UTC (permalink / raw)
  To: davem; +Cc: netdev

When gracefully stopping the controller, the driver was continuing if
*either* RX or TX had stopped.  We need to wait for both, or the
controller could get into an invalid state.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 drivers/net/gianfar.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 032073d..6038397 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1571,8 +1571,9 @@ static void gfar_halt_nodisable(struct net_device *dev)
 		tempval |= (DMACTRL_GRS | DMACTRL_GTS);
 		gfar_write(&regs->dmactrl, tempval);
 
-		while (!(gfar_read(&regs->ievent) &
-			 (IEVENT_GRSC | IEVENT_GTSC)))
+		while ((gfar_read(&regs->ievent) &
+			 (IEVENT_GRSC | IEVENT_GTSC)) !=
+			 (IEVENT_GRSC | IEVENT_GTSC))
 			cpu_relax();
 	}
 }
-- 
1.6.5.2.g6ff9a


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

end of thread, other threads:[~2010-04-21 21:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18 23:13 [PATCH] gianfar: Wait for both RX and TX to stop Andy Fleming
2010-04-19 21:08 ` Timur Tabi
2010-04-20  4:43   ` Kumar Gala
2010-04-20 15:01     ` Timur Tabi
2010-04-20 15:59       ` Timur Tabi
2010-04-21  1:06       ` David Miller
2010-04-21  4:22         ` Kumar Gala
2010-04-21  5:36           ` David Miller
2010-04-21 12:17             ` Kumar Gala
2010-04-21 14:33               ` Timur Tabi
2010-04-21 19:13                 ` Kumar Gala
2010-04-21 21:33                   ` David Miller
2010-04-20  4:44 ` Kumar Gala
2010-04-20  8:18   ` David Miller

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