[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1271632401-2472-1-git-send-email-afleming@freescale.com>
Date: Sun, 18 Apr 2010 18:13:21 -0500
From: Andy Fleming <afleming@...escale.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org
Subject: [PATCH] gianfar: Wait for both RX and TX to stop
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@...escale.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(®s->dmactrl, tempval);
- while (!(gfar_read(®s->ievent) &
- (IEVENT_GRSC | IEVENT_GTSC)))
+ while ((gfar_read(®s->ievent) &
+ (IEVENT_GRSC | IEVENT_GTSC)) !=
+ (IEVENT_GRSC | IEVENT_GTSC))
cpu_relax();
}
}
--
1.6.5.2.g6ff9a
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists