gianfar: Wait for both RX and TX to stop
Subsystems (2)
PATCH v2 1/1 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.
---
Switched to use spin_event_timeout()
Kept the -1 timeout value, as that is the original behavior, and responding to a timeout would require a much more substantial change, and such a change would, at the least, require investigation of what, if anything, *can* be done.
drivers/net/gianfar.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/gianfar.c +3 -3
@@ -1567,9 +1567,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 ); } }
Signature · 1 line
1.6.5.2.g6ff9a
From: Andy Fleming <[email protected]>
Date: Tue, 27 Apr 2010 17:51:43 -0500
Quoted 5 lines
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 <[email protected]>
Applied, thanks.