Re-post to linux-arch of a discussion on lkml. Mostly due to lack of reactions :-) 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 ? The reason is that on archs that are out of order, this would allow us to get rid in the long run of some of the heavy barriers we have put in our readl/writel implementations to make them look like x86. Note that there are drivers that already do that (ie. explicit rmb/wmb/mb to order coherent memory accesses vs. MMIO), such as OHCI/EHCI which may explain why the new problem with gcc isn't more obviously hitting people, as those turn into compiler barriers on x86. If that approach is accepted, then I'll start auditing drivers and send patches adding wmb/rmb/mb's to them, and in the long run, after mucho testing, relax powerpc writel/readl implementations. Other archs can then do the same too If that approach is generally considered wrong, then we should probably remove the spurrious readl/writel in drivers that do them. So what are the opinions here ? Cheers, Ben. --
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Mark Lord | 2.6.25-rc8: FTP transfer errors |
| Marcin Slusarz | Re: 2.6.25-rc2-mm1: build failure (x86) |
| Balbir Singh | Re: [RFC][PATCH 2/7] RSS controller core |
git: | |
| bcpa | Binkley/Rfmaill/Cnews scripts?.. |
| Rogier Wolff | Re: MIPS R3000 board to run Linux, anyone? |
| Gary Kahn | compiled ghostscript, got 2 megabyte executable |
| Joshua Lobel | Does anyone know anything about LOCUS' DOS MERGE running on Linux |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
