Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining

From: Benjamin LaHaise
Date: Sat Feb 25 2006 - 09:31:04 EST


On Fri, Feb 24, 2006 at 08:20:50PM -0800, Bryan O'Sullivan wrote:
> On some platforms, a regular wmb() is not sufficient to guarantee that
> PCI writes have been flushed to the bus if write combining is in effect.
>
> This change introduces a new macro, wc_wmb(), that makes this guarantee.
>
> It does so by way of a new header file, <linux/system.h>. This header
> can be a site for oft-replicated code from <asm-*/system.h>, but isn't
> just yet.
>
> We also define a version of wc_wmb() with the required semantics
> on x86_64.

This does not do what you're trying to accomplish. sfence has no impact
on the flushing of the write combining buffers -- they're normally flushed
after a few cycles of no subsequent merges. If it is really necessary to
flush such a write, you will have to do a read from the target PCI device
(well, bus would do).

-ben
--
"Ladies and gentlemen, I'm sorry to interrupt, but the police are here
and they've asked us to stop the party." Don't Email: <dont@xxxxxxxxx>.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/