Commit b8806e0c authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Alexandre Belloni

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

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: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20230921055704.1087277-10-jarkko.nikula@linux.intel.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 7ccd40ed
...@@ -347,6 +347,8 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci, ...@@ -347,6 +347,8 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci,
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
xfer = xfer_list + i; xfer = xfer_list + i;
if (!xfer->data)
continue;
dma_unmap_single(&hci->master.dev, dma_unmap_single(&hci->master.dev,
xfer->data_dma, xfer->data_len, xfer->data_dma, xfer->data_len,
xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE); xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment