blob: 4774cb39956efa229d5981860af8b42a3f51583d [file] [log] [blame]
developer5d148cb2023-06-02 13:08:11 +08001From f715b301cff26297a1f4af71e6982de3d56673dd Mon Sep 17 00:00:00 2001
2From: Sam Shih <sam.shih@mediatek.com>
3Date: Fri, 2 Jun 2023 13:06:20 +0800
4Subject: [PATCH]
5 [spi-and-storage][999-2368-kernel-MT7988-fix-spi-dma-unmap.patch]
6
7---
8 drivers/spi/spi-mt65xx.c | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-)
10
11diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
12index 2883dc908..b03257132 100644
13--- a/drivers/spi/spi-mt65xx.c
14+++ b/drivers/spi/spi-mt65xx.c
15@@ -957,12 +957,12 @@ static int mtk_spi_mem_exec_op(struct spi_mem *mem,
16
17 unmap_rx_dma:
18 if (op->data.dir == SPI_MEM_DATA_IN) {
19+ dma_unmap_single(mdata->dev, mdata->rx_dma,
20+ op->data.nbytes, DMA_FROM_DEVICE);
21 if(!IS_ALIGNED((size_t)op->data.buf.in, 4)) {
22 memcpy(op->data.buf.in, rx_tmp_buf, op->data.nbytes);
23 kfree(rx_tmp_buf);
24 }
25- dma_unmap_single(mdata->dev, mdata->rx_dma,
26- op->data.nbytes, DMA_FROM_DEVICE);
27 }
28 unmap_tx_dma:
29 dma_unmap_single(mdata->dev, mdata->tx_dma,
30--
312.34.1
32