spi: spi-cadence: Reverse the order of interleaved write and read operations
authorAmit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Mon, 18 Dec 2023 09:06:52 +0000 (14:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:13 +0000 (16:19 -0800)
commit1bd81374bc2fa7ae98824b4eb9ac3e97c29d6971
tree1fa8835d81fab66a5f1b8ec642b1433b80e57a33
parent26e85f7b0a16a284acd1d181a9869dccf1d5ca90
spi: spi-cadence: Reverse the order of interleaved write and read operations

[ Upstream commit 633cd6fe6e1993ba80e0954c2db127a0b1a3e66f ]

In the existing implementation, when executing interleaved write and read
operations in the ISR for a transfer length greater than the FIFO size,
the TXFIFO write precedes the RXFIFO read. Consequently, the initially
received data in the RXFIFO is pushed out and lost, leading to a failure
in data integrity. To address this issue, reverse the order of interleaved
operations and conduct the RXFIFO read followed by the TXFIFO write.

Fixes: 6afe2ae8dc48 ("spi: spi-cadence: Interleave write of TX and read of RX FIFO")
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Link: https://msgid.link/r/20231218090652.18403-1-amit.kumar-mahapatra@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-cadence.c