All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tsec: Wait for both RX and TX to stop
Date: Sun, 25 Apr 2010 21:52:35 -0700	[thread overview]
Message-ID: <4BD51C13.6060904@gmail.com> (raw)
In-Reply-To: <1271706889-8894-1-git-send-email-afleming@freescale.com>

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

      reply	other threads:[~2010-04-26  4:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD51C13.6060904@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.