[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210908074822.16793-1-andreas@gaisler.com>
Date: Wed, 8 Sep 2021 09:48:22 +0200
From: Andreas Larsson <andreas@...sler.com>
To: David Miller <davem@...emloft.net>, sparclinux@...r.kernel.org
Cc: Christoph Hellwig <hch@....de>, Sam Ravnborg <sam@...nborg.org>,
linux-kernel@...r.kernel.org, software@...sler.com
Subject: [PATCH] sparc32: Page align size in arch_dma_alloc
Commit 53b7670e5735 ("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@...sler.com>
---
arch/sparc/kernel/ioport.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 8e1d72a16759..7ceae24b0ca9 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists