Patch "dmaengine: stm32-dma: fix stm32_dma_get_max_width" has been added to the 5.14-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

    dmaengine: stm32-dma: fix stm32_dma_get_max_width

to the 5.14-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:
     dmaengine-stm32-dma-fix-stm32_dma_get_max_width.patch
and it can be found in the queue-5.14 subdirectory.

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



commit c9ca50a174f9b7635034e1ec18266a5a4d544ad2
Author: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
Date:   Mon Oct 11 11:42:58 2021 +0200

    dmaengine: stm32-dma: fix stm32_dma_get_max_width
    
    [ Upstream commit b20fd5fa310cbf7ec367f263a34382a24c4cee73 ]
    
    buf_addr parameter of stm32_dma_set_xfer_param function is a dma_addr_t.
    We only need to check the remainder of buf_addr/max_width, so, no need to
    use do_div and extra u64 addr. Use '%' instead.
    
    Fixes: e0ebdbdcb42a ("dmaengine: stm32-dma: take address into account when computing max width")
    Signed-off-by: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211011094259.315023-3-amelie.delaunay@xxxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 7dd1d3d0bf063..a5dab5510e625 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -268,7 +268,6 @@ static enum dma_slave_buswidth stm32_dma_get_max_width(u32 buf_len,
 						       u32 threshold)
 {
 	enum dma_slave_buswidth max_width;
-	u64 addr = buf_addr;
 
 	if (threshold == STM32_DMA_FIFO_THRESHOLD_FULL)
 		max_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -279,7 +278,7 @@ static enum dma_slave_buswidth stm32_dma_get_max_width(u32 buf_len,
 	       max_width > DMA_SLAVE_BUSWIDTH_1_BYTE)
 		max_width = max_width >> 1;
 
-	if (do_div(addr, max_width))
+	if (buf_addr % max_width)
 		max_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
 
 	return max_width;



[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