diff options
Diffstat (limited to 'arch/microblaze/kernel/dma.c')
-rw-r--r-- | arch/microblaze/kernel/dma.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c index ec04dc1e2527..818daf230eb4 100644 --- a/arch/microblaze/kernel/dma.c +++ b/arch/microblaze/kernel/dma.c | |||
@@ -61,6 +61,10 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, | |||
61 | /* FIXME this part of code is untested */ | 61 | /* FIXME this part of code is untested */ |
62 | for_each_sg(sgl, sg, nents, i) { | 62 | for_each_sg(sgl, sg, nents, i) { |
63 | sg->dma_address = sg_phys(sg); | 63 | sg->dma_address = sg_phys(sg); |
64 | |||
65 | if (attrs & DMA_ATTR_SKIP_CPU_SYNC) | ||
66 | continue; | ||
67 | |||
64 | __dma_sync(page_to_phys(sg_page(sg)) + sg->offset, | 68 | __dma_sync(page_to_phys(sg_page(sg)) + sg->offset, |
65 | sg->length, direction); | 69 | sg->length, direction); |
66 | } | 70 | } |
@@ -80,7 +84,8 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev, | |||
80 | enum dma_data_direction direction, | 84 | enum dma_data_direction direction, |
81 | unsigned long attrs) | 85 | unsigned long attrs) |
82 | { | 86 | { |
83 | __dma_sync(page_to_phys(page) + offset, size, direction); | 87 | if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) |
88 | __dma_sync(page_to_phys(page) + offset, size, direction); | ||
84 | return page_to_phys(page) + offset; | 89 | return page_to_phys(page) + offset; |
85 | } | 90 | } |
86 | 91 | ||
@@ -95,7 +100,8 @@ static inline void dma_direct_unmap_page(struct device *dev, | |||
95 | * phys_to_virt is here because in __dma_sync_page is __virt_to_phys and | 100 | * phys_to_virt is here because in __dma_sync_page is __virt_to_phys and |
96 | * dma_address is physical address | 101 | * dma_address is physical address |
97 | */ | 102 | */ |
98 | __dma_sync(dma_address, size, direction); | 103 | if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) |
104 | __dma_sync(dma_address, size, direction); | ||
99 | } | 105 | } |
100 | 106 | ||
101 | static inline void | 107 | static inline void |