summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorQuanyang Wang <quanyang.wang@windriver.com>2021-04-08 07:02:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 10:50:18 +0300
commitcbe254a1fdce3b7ebb9a2a2f04ce35e04fa9b1f6 (patch)
tree35c8d99308733c4a40775fbd42aec8eb082b7b16 /drivers/spi
parent314469666791be52fabd2f9a2026b4e388aaedfb (diff)
downloadlinux-cbe254a1fdce3b7ebb9a2a2f04ce35e04fa9b1f6.tar.xz
spi: spi-zynqmp-gqspi: fix incorrect operating mode in zynqmp_qspi_read_op
[ Upstream commit 41d310930084502433fcb3c4baf219e7424b7734 ] When starting a read operation, we should call zynqmp_qspi_setuprxdma first to set xqspi->mode according to xqspi->bytes_to_receive and to calculate correct xqspi->dma_rx_bytes. Then in the function zynqmp_qspi_fillgenfifo, generate the appropriate command with operating mode and bytes to transfer, and fill the GENFIFO with the command to perform the read operation. Calling zynqmp_qspi_fillgenfifo before zynqmp_qspi_setuprxdma will result in incorrect transfer length and operating mode. So change the calling order to fix this issue. Fixes: 1c26372e5aa9 ("spi: spi-zynqmp-gqspi: Update driver to use spi-mem framework") Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com> Reviewed-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com> Link: https://lore.kernel.org/r/20210408040223.23134-5-quanyang.wang@windriver.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-zynqmp-gqspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index cf73a069b759..036d8ae41c06 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -827,8 +827,8 @@ static void zynqmp_qspi_write_op(struct zynqmp_qspi *xqspi, u8 tx_nbits,
static void zynqmp_qspi_read_op(struct zynqmp_qspi *xqspi, u8 rx_nbits,
u32 genfifoentry)
{
- zynqmp_qspi_fillgenfifo(xqspi, rx_nbits, genfifoentry);
zynqmp_qspi_setuprxdma(xqspi);
+ zynqmp_qspi_fillgenfifo(xqspi, rx_nbits, genfifoentry);
}
/**