Re: Memory vs. MMIO ordering, again

From: Alan Cox
Date: Wed Dec 24 2008 - 19:12:18 EST


> What that documentation is suggesting is that MMIO writes to uncached
> memory (what the normal mapping functions will give you) can pass
> previous writes to cached memory. It doesn't indicate how this is to be
> avoided, however.

They can. How you avoid it depends upon the bus but the problem is really
really rare as a corner case and almost the only device affected is
graphics because nobody uses cached memory on the PCI bus except graphics
cards and a couple of obscure other cases like I2O.

The graphics people implement various fencing operations and they are
generally tied down low level with AGP, GARTs and other places mere
mortals (ie most people except the DRI team) should not tread ;)

You need to distinguish between cachable memory remote on things like the
PCI bus (eg frame buffers) which are your problem and cachable memory in
the sense of main memory, which is handled by the pci_map functions or
kept coherent if allocated via the PCI coherent memory allocator - in
which case all you have to watch is the compiler and write buffers on the
CPU.

--
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/