[PATCH 3/3] net: hisilicon: new hip04 ethernet driver
David Laight
David.Laight at ACULAB.COM
Thu Apr 3 08:42:00 PDT 2014
From: Russell King - ARM Linux
> DMA coherent memory is write combining, so multiple writes will be
> coalesced. This also means that barriers may be required to ensure the
> descriptors are pushed out in a timely manner if something like writel()
> is not used in the transmit-triggering path.
You also have to ensure that the write that changes the 'owner'
bit is the one that happens last.
If (for example) a descriptor has two words, one containing the
buffer address and the other containing the length and flags,
then you have to absolutely ensure that the hardware will not
read the new 'flags' with the old 'buffer address'.
Any write to tell the hardware to look at the tx ring won't
help you - the hardware might be reading the descriptor anyway.
Even if the accesses are uncached, you need the appropriate
barrier (or volatiles) to stop gcc reordering the writes.
(I think accesses to volatiles can't be reordered - check.)
David
More information about the linux-arm-kernel
mailing list