Skip to content

Commit 59583f7

Browse files
andreas-gaislerChristoph Hellwig
authored andcommitted
sparc32: page align size in arch_dma_alloc
Commit 53b7670 ("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: Andreas Larsson <andreas@gaisler.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 510e1a7 commit 59583f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/sparc/kernel/ioport.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
356356
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
357357
dma_addr_t dma_addr, unsigned long attrs)
358358
{
359-
if (!sparc_dma_free_resource(cpu_addr, PAGE_ALIGN(size)))
359+
size = PAGE_ALIGN(size);
360+
361+
if (!sparc_dma_free_resource(cpu_addr, size))
360362
return;
361363

362364
dma_make_coherent(dma_addr, size);

0 commit comments

Comments
 (0)