public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [Patch V7 04/18] net/fm/eth: Use mb() to be compatible for both ARM and PowerPC
Date: Thu, 22 Oct 2015 18:10:52 -0500	[thread overview]
Message-ID: <1445555452.701.117.camel@freescale.com> (raw)
In-Reply-To: <1445510763-40579-2-git-send-email-Qianyu.Gong@freescale.com>

On Thu, 2015-10-22 at 18:46 +0800, Gong Qianyu wrote:
> From: Shaohui Xie <Shaohui.Xie@freescale.com>
> 
> Use mb() instead of sync() to be compatible for both ARM and PowerPC.
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
> ---
> V7:
>  - No change.
> V6:
>  - No change.
> V5:
>  - No change.
> V4:
>  - No change.
> V3:
>  - New patch. Separated from patch 'net: Move some header files to include/'
> 
>  drivers/net/fm/eth.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
> index 368d554..ad02c66 100644
> --- a/drivers/net/fm/eth.c
> +++ b/drivers/net/fm/eth.c
> @@ -371,7 +371,7 @@ static void fmc_tx_port_graceful_stop_enable(struct 
> fm_eth *fm_eth)
>       pram = fm_eth->tx_pram;
>       /* graceful stop transmission of frames */
>       setbits_be32(&pram->mode, PRAM_MODE_GRACEFUL_STOP);
> -     sync();
> +     mb();
>  }
>  
>  static void fmc_tx_port_graceful_stop_disable(struct fm_eth *fm_eth)
> @@ -381,7 +381,7 @@ static void fmc_tx_port_graceful_stop_disable(struct 
> fm_eth *fm_eth)
>       pram = fm_eth->tx_pram;
>       /* re-enable transmission of frames */
>       clrbits_be32(&pram->mode, PRAM_MODE_GRACEFUL_STOP);
> -     sync();
> +     mb();
>  }

Why is it needed at all?  The I/O accessors should include the necessary 
barriers.

-Scott

  reply	other threads:[~2015-10-22 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 10:46 [U-Boot] [Patch V7 03/18] net/fm: Fix the endian issue to support both endianness platforms Gong Qianyu
2015-10-22 10:46 ` [U-Boot] [Patch V7 04/18] net/fm/eth: Use mb() to be compatible for both ARM and PowerPC Gong Qianyu
2015-10-22 23:10   ` Scott Wood [this message]
2015-10-23 11:01     ` Hou Zhiqiang
2015-10-23 13:42       ` Scott Wood
2015-10-26  8:14         ` Gong Q.Y.

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=1445555452.701.117.camel@freescale.com \
    --to=scottwood@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox