| From f715b301cff26297a1f4af71e6982de3d56673dd Mon Sep 17 00:00:00 2001 |
| From: Sam Shih <sam.shih@mediatek.com> |
| Date: Fri, 2 Jun 2023 13:06:20 +0800 |
| Subject: [PATCH] |
| [spi-and-storage][999-2368-kernel-MT7988-fix-spi-dma-unmap.patch] |
| |
| --- |
| drivers/spi/spi-mt65xx.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c |
| index 2883dc908..b03257132 100644 |
| --- a/drivers/spi/spi-mt65xx.c |
| +++ b/drivers/spi/spi-mt65xx.c |
| @@ -957,12 +957,12 @@ static int mtk_spi_mem_exec_op(struct spi_mem *mem, |
| |
| unmap_rx_dma: |
| if (op->data.dir == SPI_MEM_DATA_IN) { |
| + dma_unmap_single(mdata->dev, mdata->rx_dma, |
| + op->data.nbytes, DMA_FROM_DEVICE); |
| if(!IS_ALIGNED((size_t)op->data.buf.in, 4)) { |
| memcpy(op->data.buf.in, rx_tmp_buf, op->data.nbytes); |
| kfree(rx_tmp_buf); |
| } |
| - dma_unmap_single(mdata->dev, mdata->rx_dma, |
| - op->data.nbytes, DMA_FROM_DEVICE); |
| } |
| unmap_tx_dma: |
| dma_unmap_single(mdata->dev, mdata->tx_dma, |
| -- |
| 2.34.1 |
| |