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 v5 01/23] ppc: Add initial memory barrier macros
Date: Tue, 12 Feb 2013 12:50:22 -0600	[thread overview]
Message-ID: <1360695022.24612.5@snotra> (raw)
In-Reply-To: <CAPnjgZ3c_PWdg3-J7eud-7-wVciCCK0YiKYSdRb3SbmFfbOv_A@mail.gmail.com> (from sjg@chromium.org on Tue Feb 12 12:44:16 2013)

On 02/12/2013 12:44:16 PM, Simon Glass wrote:
> Hi Scott,
> 
> On Mon, Feb 11, 2013 at 11:52 AM, Scott Wood  
> <scottwood@freescale.com> wrote:
> > On 02/08/2013 09:11:57 AM, Simon Glass wrote:
> >>
> >> These are available on other architectures, so add them on ppc.
> >>
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> >> ---
> >> Changes in v5: None
> >> Changes in v4: None
> >> Changes in v3: None
> >> Changes in v2: None
> >>
> >>  arch/powerpc/include/asm/io.h | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/arch/powerpc/include/asm/io.h  
> b/arch/powerpc/include/asm/io.h
> >> index 1f12c29..1bf12f5 100644
> >> --- a/arch/powerpc/include/asm/io.h
> >> +++ b/arch/powerpc/include/asm/io.h
> >> @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void *  
> vaddr)
> >>  #endif
> >>  }
> >>
> >> +/*
> >> + * TODO: The kernel offers some more advanced versions of  
> barriers, it
> >> might
> >> + * have some advantages to use them instead of the simple one  
> here.
> >> + */
> >> +#define dmb()          __asm__ __volatile__ ("" : : : "memory")
> >> +#define __iormb()      dmb()
> >> +#define __iowmb()      dmb()
> >
> >
> > What is the definition of these?  Given that we already have an
> > architecture-independent barrier(), I assume this is meant to be an  
> actual
> > hardware barrier rather than a compiler barrier, so this is not a  
> correct
> > implementation.
> 
> They were introduced in ARM in commit 3c0659b5, so I am really just
> following along with that. Yes the naming doesn't make a lot of sense,
> but on the other hand I don't think we necessarily want an actual
> hardware barrier in our writel()s.

We do have a hardware barrier in writel() on PPC (ignoring the broken  
never-used little-endian implementation, which should just be removed),  
and it should stay that way.

I do not think we should be introducing anything that looks like a  
hardware barrier but isn't, unless the semantics of a particular  
barrier are guaranteed by a particular platform without needing a  
barrier instruction.  And in that case there had better be a document  
somewhere that explains what the semantics are.

> This at least makes sure that the
> compiler writes in the right order - perhaps the intent is that that
> rest is best left to the hardware?

Regardless of what one might think is "best", it isn't left to hardware  
on many platforms, including PPC.

-Scott

  reply	other threads:[~2013-02-12 18:50 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 15:11 [U-Boot] [PATCH v5 0/23] Create generic board init for ARM, x86, PPC Simon Glass
2013-02-08 15:11 ` [U-Boot] [PATCH v5 01/23] ppc: Add initial memory barrier macros Simon Glass
2013-02-11 19:52   ` Scott Wood
2013-02-12 18:44     ` Simon Glass
2013-02-12 18:50       ` Scott Wood [this message]
2013-02-12 18:55         ` Simon Glass
2013-02-12 19:04           ` Scott Wood
2013-02-12 19:06             ` Simon Glass
2013-02-08 15:11 ` [U-Boot] [PATCH v5 02/23] Introduce generic u-boot.h file Simon Glass
2013-02-08 15:11 ` [U-Boot] [PATCH v5 03/23] Replace __bss_end__ with __bss_end Simon Glass
2013-02-18 20:13   ` Tom Rini
2013-02-18 21:40     ` Otavio Salvador
2013-02-19  0:23       ` Simon Glass
2013-02-19  0:30         ` Otavio Salvador
2013-02-19  0:32           ` Simon Glass
2013-02-18 23:20   ` Andy Fleming
2013-02-08 15:12 ` [U-Boot] [PATCH v5 04/23] Introduce generic link section.h symbol files Simon Glass
2013-02-18 20:12   ` Tom Rini
2013-02-08 15:12 ` [U-Boot] [PATCH v5 05/23] arm: Use sections header to obtain link symbols Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 06/23] x86: nds32: Change stub example to use asm-generic/sections.h Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 07/23] Introduce a basic initcall implementation Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 08/23] Define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 09/23] Declare watchdog functions in watchdog.h Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 10/23] Introduce generic pre-relocation board_f.c Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 11/23] Introduce generic post-relocation board_r.c Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 12/23] Add spl load feature Simon Glass
2013-02-12 20:29   ` Scott Wood
2013-02-12 22:23     ` Simon Glass
2013-02-12 22:34       ` Scott Wood
2013-03-02 23:39         ` Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 13/23] arm: Remove use of board_early_init_r/last_stage_init() Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 14/23] arm: Enable generic board support Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 15/23] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 16/23] Adjust board_f.c for ppc Simon Glass
2013-02-12 22:32   ` Scott Wood
2013-02-12 22:41     ` Simon Glass
2013-02-12 22:48       ` Scott Wood
2013-02-08 15:12 ` [U-Boot] [PATCH v5 17/23] Adjust board_r.c " Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 18/23] ppc: Enable generic board support Simon Glass
2013-02-12 20:38   ` Scott Wood
2013-02-12 22:29     ` Simon Glass
2013-02-12 22:40       ` Scott Wood
2013-02-08 15:12 ` [U-Boot] [PATCH v5 19/23] x86: Adjust board_f.c for x86 Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 20/23] x86: Adjust board_r.c " Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 21/23] x86: Use sections header to obtain link symbols Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 22/23] x86: Enable generic board support Simon Glass
2013-02-08 15:12 ` [U-Boot] [PATCH v5 23/23] tegra: Enable generic board for Seaboard Simon Glass
2013-02-08 17:23   ` Stephen Warren
2013-02-08 18:10     ` Simon Glass
2013-02-08 19:12       ` Stephen Warren

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=1360695022.24612.5@snotra \
    --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