Commit 59583f74 authored by Andreas Larsson's avatar Andreas Larsson Committed by Christoph Hellwig

sparc32: page align size in arch_dma_alloc

Commit 53b7670e ("sparc: factor the dma coherent mapping into
helper") lost the page align for the calls to dma_make_coherent and
srmmu_unmapiorange. The latter cannot handle a non page aligned len
argument.
Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 510e1a72
......@@ -356,7 +356,9 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
dma_addr_t dma_addr, unsigned long attrs)
{
if (!sparc_dma_free_resource(cpu_addr, PAGE_ALIGN(size)))
size = PAGE_ALIGN(size);
if (!sparc_dma_free_resource(cpu_addr, size))
return;
dma_make_coherent(dma_addr, 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