All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tsec: Wait for both RX and TX to stop
@ 2010-04-19 19:54 Andy Fleming
  2010-04-26  4:52 ` Ben Warren
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Fleming @ 2010-04-19 19:54 UTC (permalink / raw)
  To: u-boot

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>
---
 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 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);
 
-- 
1.6.5.2.g6ff9a

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] tsec: Wait for both RX and TX to stop
  2010-04-19 19:54 [U-Boot] [PATCH] tsec: Wait for both RX and TX to stop Andy Fleming
@ 2010-04-26  4:52 ` Ben Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Warren @ 2010-04-26  4:52 UTC (permalink / raw)
  To: u-boot

Andy,

On 4/19/2010 12:54 PM, Andy Fleming wrote:
> 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>
> ---
>   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 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);
>
>    
Applied to net repo.

thanks,
Ben

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-26  4:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 19:54 [U-Boot] [PATCH] tsec: Wait for both RX and TX to stop Andy Fleming
2010-04-26  4:52 ` Ben Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.