Commit 12c45d9b authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by james toy

There is no need to perform full BIDIR sync (copying the buffers in case

of swiotlb and similar schemes) if we know that the owner (CPU or device)
hasn't altered the data.

Addresses the false-positive reported at
http://bugzilla.kernel.org/show_bug.cgi?id=14169Signed-off-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Cc: David Miller <davem@davemloft.net>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 01e8e8d2
......@@ -909,6 +909,9 @@ static void check_sync(struct device *dev,
ref->size);
}
if (entry->direction == DMA_BIDIRECTIONAL)
goto out;
if (ref->direction != entry->direction) {
err_printk(dev, entry, "DMA-API: device driver syncs "
"DMA memory with different direction "
......@@ -919,9 +922,6 @@ static void check_sync(struct device *dev,
dir2name[ref->direction]);
}
if (entry->direction == DMA_BIDIRECTIONAL)
goto out;
if (to_cpu && !(entry->direction == DMA_FROM_DEVICE) &&
!(ref->direction == DMA_TO_DEVICE))
err_printk(dev, entry, "DMA-API: device driver syncs "
......@@ -944,7 +944,6 @@ static void check_sync(struct device *dev,
out:
put_hash_bucket(bucket, &flags);
}
void debug_dma_map_page(struct device *dev, struct page *page, size_t offset,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment