diff options
author | Andy Fleming <afleming@freescale.com> | 2010-04-20 11:59:38 +0530 |
---|---|---|
committer | Scott Sweeny <scott.sweeny@timesys.com> | 2010-11-10 14:53:04 -0500 |
commit | 43721c9b3ebc15681a74c65dec2ff529d20101bd (patch) | |
tree | 9c2465c39956fd86b23a5d81b704a37a5227eecf | |
parent | 2c7c1b896f75985d849423bab927db8378991a63 (diff) |
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>
-rw-r--r-- | drivers/net/tsec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index da496485eb8..fd72a14ba33 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -988,7 +988,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); |