From: Andy Fleming Date: Tue, 27 Apr 2010 23:43:31 +0000 (-0700) Subject: gianfar: Wait for both RX and TX to stop X-Git-Tag: v2.6.34-rc6~13^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=761ed01b35ca32bfd4166cc3862ae80ee33e3a4b;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index df49af3..4e97ca1 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -1511,9 +1511,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))) - cpu_relax(); + spin_event_timeout(((gfar_read(®s->ievent) & + (IEVENT_GRSC | IEVENT_GTSC)) == + (IEVENT_GRSC | IEVENT_GTSC)), -1, 0); } }