[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080526.184047.88207142.davem@davemloft.net>
Date: Mon, 26 May 2008 18:40:47 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: benh@...nel.crashing.org
Cc: linux-arch@...r.kernel.org, scottwood@...escale.com,
linuxppc-dev@...abs.org, alan@...rguk.ukuu.org.uk,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
tpiepho@...escale.com
Subject: Re: MMIO and gcc re-ordering issue
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Date: Tue, 27 May 2008 11:33:46 +1000
> Quick summary: gcc is happily re-ordering readl/writel vs. surrounding
> memory accesses (and thus accesses to DMA coherent memory) which is
> obviously a _BAD_THING_.
>
> This is on all archs. Quick fix is to stick a "memory" clobber in all arch
> implementations of readl/writel/... (ie, making them a barrier()).
>
> However, I'm using that as an excuse to bring back my pet subject, which
> is basically, should we instead just finally mandate the use of explicit
> rmb/wmb/mb's (which boils down to barrier() on x86) to drivers who want
> to order memory consistent accesses vs. MMIO ?
This is basically what drivers are effectively doing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists