Commit 961729bf authored by Christoph Hellwig's avatar Christoph Hellwig

openrisc: remove the partial DMA_ATTR_NON_CONSISTENT support

The openrisc DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but
does not provide a cache_sync operation.  This means any user of it
will never be able to actually transfer cache ownership and thus cause
coherency bugs.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarStafford Horne <shorne@gmail.com>
parent 80e61fcd
...@@ -98,15 +98,13 @@ arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, ...@@ -98,15 +98,13 @@ arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
va = (unsigned long)page; va = (unsigned long)page;
if ((attrs & DMA_ATTR_NON_CONSISTENT) == 0) { /*
/* * We need to iterate through the pages, clearing the dcache for
* We need to iterate through the pages, clearing the dcache for * them and setting the cache-inhibit bit.
* them and setting the cache-inhibit bit. */
*/ if (walk_page_range(va, va + size, &walk)) {
if (walk_page_range(va, va + size, &walk)) { free_pages_exact(page, size);
free_pages_exact(page, size); return NULL;
return NULL;
}
} }
return (void *)va; return (void *)va;
...@@ -122,10 +120,8 @@ arch_dma_free(struct device *dev, size_t size, void *vaddr, ...@@ -122,10 +120,8 @@ arch_dma_free(struct device *dev, size_t size, void *vaddr,
.mm = &init_mm .mm = &init_mm
}; };
if ((attrs & DMA_ATTR_NON_CONSISTENT) == 0) { /* walk_page_range shouldn't be able to fail here */
/* walk_page_range shouldn't be able to fail here */ WARN_ON(walk_page_range(va, va + size, &walk));
WARN_ON(walk_page_range(va, va + size, &walk));
}
free_pages_exact(vaddr, size); free_pages_exact(vaddr, size);
} }
......
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