When doing a PREREAD sync of an mbuf-type dma buffer, do a writeback of
authorian <ian@FreeBSD.org>
Sat, 22 Nov 2014 03:03:11 +0000 (03:03 +0000)
committerian <ian@FreeBSD.org>
Sat, 22 Nov 2014 03:03:11 +0000 (03:03 +0000)
commit2cb1b07d692ea2df25e5f96a8f079f14c73230a2
treeb0819b68de072dad0e64a6bc7210352ff727d757
parentc6174eb57aa8d47866f82960faf3e9f775232925
When doing a PREREAD sync of an mbuf-type dma buffer, do a writeback of
the first cacheline if the buffer start address is not on a cacheline
boundary.  Normally a buffer which is not cacheline-aligned is bounced,
but a special rule applies for mbufs, which are always misaligned due to
the header.  We know the cpu will not write to the header while dma is in
progress (so we've been told anyway), but it may have written to the
header shortly before starting a read, so we need to flush that write out
to memory before invalidating the whole buffer.

In collaboration with Mical Meloun and Svata Kraus.
sys/arm/arm/busdma_machdep-v6.c