Patch "sparc32: page align size in arch_dma_alloc" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sparc32: page align size in arch_dma_alloc

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sparc32-page-align-size-in-arch_dma_alloc.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 575fabb2ee3efdcb62a23c118bb49523ecf140eb
Author: Andreas Larsson <andreas@xxxxxxxxxxx>
Date:   Wed Sep 8 09:48:22 2021 +0200

    sparc32: page align size in arch_dma_alloc
    
    [ Upstream commit 59583f747664046aaae5588d56d5954fab66cce8 ]
    
    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@xxxxxxxxxxx>
    Reviewed-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index f89603855f1e..b87e0002131d 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -356,7 +356,9 @@ err_nomem:
 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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux