Patch "i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer" has been added to the 5.15-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

    i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer

to the 5.15-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:
     i3c-mipi-i3c-hci-do-not-unmap-region-not-mapped-for-.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 90b26d213a93e68b78294aae5152b680c0eefdfa
Author: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx>
Date:   Thu Sep 21 08:57:01 2023 +0300

    i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer
    
    [ Upstream commit b8806e0c939f168237593af0056c309bf31022b0 ]
    
    Fix following warning (with CONFIG_DMA_API_DEBUG) which happens with a
    transfer without a data buffer.
    
            DMA-API: i3c mipi-i3c-hci.0: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=0 bytes]
    
    For those transfers the hci_dma_queue_xfer() doesn't create a mapping and
    the DMA address pointer xfer->data_dma is not set.
    
    Signed-off-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230921055704.1087277-10-jarkko.nikula@xxxxxxxxxxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
index 7ad2edd479157..5e3f0ee1cfd0e 100644
--- a/drivers/i3c/master/mipi-i3c-hci/dma.c
+++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
@@ -345,6 +345,8 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci,
 
 	for (i = 0; i < n; i++) {
 		xfer = xfer_list + i;
+		if (!xfer->data)
+			continue;
 		dma_unmap_single(&hci->master.dev,
 				 xfer->data_dma, xfer->data_len,
 				 xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE);




[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