From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 22 Oct 2015 18:10:52 -0500 Subject: [U-Boot] [Patch V7 04/18] net/fm/eth: Use mb() to be compatible for both ARM and PowerPC In-Reply-To: <1445510763-40579-2-git-send-email-Qianyu.Gong@freescale.com> References: <1445510763-40579-1-git-send-email-Qianyu.Gong@freescale.com> <1445510763-40579-2-git-send-email-Qianyu.Gong@freescale.com> Message-ID: <1445555452.701.117.camel@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2015-10-22 at 18:46 +0800, Gong Qianyu wrote: > From: Shaohui Xie > > Use mb() instead of sync() to be compatible for both ARM and PowerPC. > > Signed-off-by: Shaohui Xie > Signed-off-by: Mingkai Hu > Signed-off-by: Gong Qianyu > --- > 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