@@ -104,26 +104,7 @@ static void __dma_phys_op(phys_addr_t paddr, size_t size, enum dma_cache_op op)
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
- switch (direction) {
- case DMA_NONE:
- BUG();
- case DMA_FROM_DEVICE:
- /*
- * invalidate only when cache-line aligned otherwise there is
- * the potential for discarding uncommitted data from the cache
- */
- if ((start | end) & (L1_CACHE_BYTES - 1))
- __dma_phys_op(start, end, DMA_CACHE_FLUSH);
- else
- __dma_phys_op(start, end, DMA_CACHE_INVAL);
- break;
- case DMA_TO_DEVICE: /* writeback only */
- __dma_phys_op(start, end, DMA_CACHE_CLEAN);
- break;
- case DMA_BIDIRECTIONAL: /* writeback and invalidate */
- __dma_phys_op(start, end, DMA_CACHE_FLUSH);
- break;
- }
+ __dma_phys_op(start, end, DMA_CACHE_CLEAN);
}
void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,