diff options
Diffstat (limited to 'arch/tile/kernel/pci-dma.c')
-rw-r--r-- | arch/tile/kernel/pci-dma.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 09bb774b39cd..24e0f8c21f2f 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -213,10 +213,12 @@ static int tile_dma_map_sg(struct device *dev, struct scatterlist *sglist, | |||
213 | 213 | ||
214 | for_each_sg(sglist, sg, nents, i) { | 214 | for_each_sg(sglist, sg, nents, i) { |
215 | sg->dma_address = sg_phys(sg); | 215 | sg->dma_address = sg_phys(sg); |
216 | __dma_prep_pa_range(sg->dma_address, sg->length, direction); | ||
217 | #ifdef CONFIG_NEED_SG_DMA_LENGTH | 216 | #ifdef CONFIG_NEED_SG_DMA_LENGTH |
218 | sg->dma_length = sg->length; | 217 | sg->dma_length = sg->length; |
219 | #endif | 218 | #endif |
219 | if (attrs & DMA_ATTR_SKIP_CPU_SYNC) | ||
220 | continue; | ||
221 | __dma_prep_pa_range(sg->dma_address, sg->length, direction); | ||
220 | } | 222 | } |
221 | 223 | ||
222 | return nents; | 224 | return nents; |
@@ -232,6 +234,8 @@ static void tile_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, | |||
232 | BUG_ON(!valid_dma_direction(direction)); | 234 | BUG_ON(!valid_dma_direction(direction)); |
233 | for_each_sg(sglist, sg, nents, i) { | 235 | for_each_sg(sglist, sg, nents, i) { |
234 | sg->dma_address = sg_phys(sg); | 236 | sg->dma_address = sg_phys(sg); |
237 | if (attrs & DMA_ATTR_SKIP_CPU_SYNC) | ||
238 | continue; | ||
235 | __dma_complete_pa_range(sg->dma_address, sg->length, | 239 | __dma_complete_pa_range(sg->dma_address, sg->length, |
236 | direction); | 240 | direction); |
237 | } | 241 | } |
@@ -245,7 +249,8 @@ static dma_addr_t tile_dma_map_page(struct device *dev, struct page *page, | |||
245 | BUG_ON(!valid_dma_direction(direction)); | 249 | BUG_ON(!valid_dma_direction(direction)); |
246 | 250 | ||
247 | BUG_ON(offset + size > PAGE_SIZE); | 251 | BUG_ON(offset + size > PAGE_SIZE); |
248 | __dma_prep_page(page, offset, size, direction); | 252 | if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) |
253 | __dma_prep_page(page, offset, size, direction); | ||
249 | 254 | ||
250 | return page_to_pa(page) + offset; | 255 | return page_to_pa(page) + offset; |
251 | } | 256 | } |
@@ -256,6 +261,9 @@ static void tile_dma_unmap_page(struct device *dev, dma_addr_t dma_address, | |||
256 | { | 261 | { |
257 | BUG_ON(!valid_dma_direction(direction)); | 262 | BUG_ON(!valid_dma_direction(direction)); |
258 | 263 | ||
264 | if (attrs & DMA_ATTR_SKIP_CPU_SYNC) | ||
265 | return; | ||
266 | |||
259 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), | 267 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), |
260 | dma_address & (PAGE_SIZE - 1), size, direction); | 268 | dma_address & (PAGE_SIZE - 1), size, direction); |
261 | } | 269 | } |