summaryrefslogtreecommitdiff
path: root/drivers/net/tsec.c
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2010-04-19 14:54:49 -0500
committerBen Warren <biggerbadderben@gmail.com>2010-05-03 14:52:48 -0700
commit538be58568542aac2ed4bdf4c05398cfa67e98f0 (patch)
tree4eff30b7ca953f5a330d545fa52b746c2de8ad60 /drivers/net/tsec.c
parenta45dde2293c816138e53c26eca6fd0322583f9a6 (diff)
downloadu-boot-imx-538be58568542aac2ed4bdf4c05398cfa67e98f0.zip
u-boot-imx-538be58568542aac2ed4bdf4c05398cfa67e98f0.tar.gz
u-boot-imx-538be58568542aac2ed4bdf4c05398cfa67e98f0.tar.bz2
tsec: 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@freescale.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/tsec.c')
-rw-r--r--drivers/net/tsec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index fd49eff..3e4c3bd 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -1082,7 +1082,8 @@ static void tsec_halt(struct eth_device *dev)
regs->dmactrl &= ~(DMACTRL_GRS | DMACTRL_GTS);
regs->dmactrl |= (DMACTRL_GRS | DMACTRL_GTS);
- while (!(regs->ievent & (IEVENT_GRSC | IEVENT_GTSC))) ;
+ while ((regs->ievent & (IEVENT_GRSC | IEVENT_GTSC))
+ != (IEVENT_GRSC | IEVENT_GTSC)) ;
regs->maccfg1 &= ~(MACCFG1_TX_EN | MACCFG1_RX_EN);