Correct the logic : we can just invalidate the cache lines, and not

write-back them, only if PREWRITE is not set, and if the buffer is
cache-line aligned.

MFC After:	1 week
This commit is contained in:
Olivier Houchard 2007-11-28 22:21:17 +00:00
parent 98bbce55fa
commit 85d18774de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174051

View File

@ -1090,7 +1090,7 @@ bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op)
cpu_l2cache_wb_range((vm_offset_t)buf, len);
}
if (op & BUS_DMASYNC_PREREAD) {
if ((op & BUS_DMASYNC_PREWRITE) ||
if (!(op & BUS_DMASYNC_PREWRITE) &&
((((vm_offset_t)(buf) | len) & arm_dcache_align_mask) == 0)) {
cpu_dcache_inv_range((vm_offset_t)buf, len);
cpu_l2cache_inv_range((vm_offset_t)buf, len);