Re: [patch] smp-2.3.30-A1, mb(), wmb(), rmb()

Linus Torvalds (torvalds@transmeta.com)
Thu, 25 Nov 1999 09:12:35 -0800 (PST)


On Thu, 25 Nov 1999, Alan Cox wrote:
>
> This doesn't make a lot of difference if any. The PCI bridge has write
> buffers and PCI doesn't claim to be synchronized in any way. PCI does have
> strict write ordering so that is safe but its ordering relative to ram is not
> deterministic.

Note that this is not a new problem.

The only way to synchronize PCI reliably is to do a PCI read from the
_same_ device you wrote to, simply because you don't know how many bridges
etc there are.

The mb/wmb/rmb stuff is still required for PCI simply because other
platforms can actually allow writes to pass each other and get re-ordered,
and if you use "__raw_[write][read]X()" you need some way of handling
that.

Although we should probably have a "io[rw]mb()" thing for that, actually.
Overloading the memory barrier with the (local device) IO ordering barrier
is bad, and not strictly correct anyway (we'll need to do "sfence" even on
ia32 when we start using unordered uncached areas.. )

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/