Skip to content

Commit 7f15010

Browse files
Christoph Hellwighdeller
authored andcommitted
parisc: always use flush_kernel_dcache_range for DMA cache maintainance
Current the S/G list based DMA ops use flush_kernel_vmap_range which contains a few UP optimizations, while the rest of the DMA operations uses flush_kernel_dcache_range. The single vs sg operations are supposed to have the same effect, so they should use the same routines. Use the more conservation version for now, but if people more familiar with parisc think the vmap version is generally fine for DMA we should switch all interfaces over to it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent a34a9b9 commit 7f15010

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/parisc/kernel/pci-dma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
537537
/* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
538538

539539
for_each_sg(sglist, sg, nents, i)
540-
flush_kernel_vmap_range(sg_virt(sg), sg->length);
540+
flush_kernel_dcache_range(sg_virt(sg), sg->length);
541541
}
542542

543543
static void pa11_dma_sync_single_for_cpu(struct device *dev,
@@ -568,7 +568,7 @@ static void pa11_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl
568568
/* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
569569

570570
for_each_sg(sglist, sg, nents, i)
571-
flush_kernel_vmap_range(sg_virt(sg), sg->length);
571+
flush_kernel_dcache_range(sg_virt(sg), sg->length);
572572
}
573573

574574
static void pa11_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
@@ -579,7 +579,7 @@ static void pa11_dma_sync_sg_for_device(struct device *dev, struct scatterlist *
579579
/* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
580580

581581
for_each_sg(sglist, sg, nents, i)
582-
flush_kernel_vmap_range(sg_virt(sg), sg->length);
582+
flush_kernel_dcache_range(sg_virt(sg), sg->length);
583583
}
584584

585585
static void pa11_dma_cache_sync(struct device *dev, void *vaddr, size_t size,

0 commit comments

Comments
 (0)