From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Mark Brown <broonie@kernel.org>,
Jisheng Zhang <jszhang@kernel.org>,
Konrad Kociolek <konrad@cadence.com>,
Jayshri Pawar <jpawar@cadence.com>,
Parshuram Thombare <pthombar@cadence.com>,
Witold Sadowski <wsadowski@marvell.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 09/10] spi: cadence-xspi: Advance tx pointer between Marvell b0 chunks
Date: Thu, 19 Nov 2026 09:17:21 +0000 [thread overview]
Message-ID: <20261119091810.3440619-10-lee@kernel.org> (raw)
In-Reply-To: <20261119091810.3440619-1-lee@kernel.org>
cdns_xspi_transfer_one_message_b0() splits transfers which are larger
than MRVL_XFER_MAX_LEN into chunks, but never advances txd between
them. For every chunk after the first, the leading byte is sent from
txd[0] again, and a short trailing chunk retransmits the start of the
buffer instead of its tail. The out_buffer pointer used for the rest
of each chunk is advanced correctly, so the data on the bus ends up
inconsistent.
Advance txd by the size of each chunk when the transfer carries TX data.
TX-less transfers continue to use the zeroed scratch buffer, which is
only ever as large as a single chunk.
Fixes: 931e389ded0f ("spi: cadence: Add Marvell xfer operation support")
Closes: https://sashiko.dev/#/bug/linux-e2ba3b72-ead8-4562-bdb2-4992253c59b4
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/spi/spi-cadence-xspi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index c4fcbf5ae091..4c9af6146a5d 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -1319,6 +1319,8 @@ static int cdns_xspi_transfer_one_message_b0(struct spi_controller *controller,
cdns_xspi->current_xfer_qword %= MRVL_XFER_QWORD_COUNT;
}
cs_change = t->cs_change;
+ if (t->tx_buf)
+ txd += current_transfer_len;
t->len -= current_transfer_len;
}
spi_transfer_delay_exec(t);
--
2.56.1.708.g77570a6a1d-goog
next prev parent reply other threads:[~2026-11-19 9:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 9:17 [PATCH 00/10] spi: Fix data corruption, uninitialised data leaks and bounds checks Lee Jones
2026-11-19 9:17 ` [PATCH 01/10] spi: fsl-cpm: Map the zero page's address, not its struct page Lee Jones
2026-11-19 9:17 ` [PATCH 02/10] spi: bcm2835: Store native chip-select GPIO descriptor per device Lee Jones
2026-11-19 9:17 ` [PATCH 03/10] spi: ch341: Limit transfers to the hardware packet size Lee Jones
2026-11-19 9:17 ` [PATCH 04/10] spi: sprd-adi: Do not copy uninitialised data to rx_buf on read failure Lee Jones
2026-11-19 9:17 ` [PATCH 05/10] spi: topcliff-pch: Advance tx_buf between DMA chunks Lee Jones
2026-11-19 9:17 ` [PATCH 06/10] spi: cadence-quadspi: Bound chip select against f_pdata array size Lee Jones
2026-11-19 9:17 ` [PATCH 07/10] spi: cadence-xspi: Zero the tail word in m_iowriteq() Lee Jones
2026-11-19 9:17 ` [PATCH 08/10] spi: fsl-qspi: Propagate clock errors from fsl_qspi_select_mem() Lee Jones
2026-11-19 9:17 ` Lee Jones [this message]
2026-11-19 9:17 ` [PATCH 10/10] spi: cadence-xspi: Skip tail read for qword-aligned Marvell b0 receives Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119091810.3440619-10-lee@kernel.org \
--to=lee@kernel.org \
--cc=broonie@kernel.org \
--cc=jpawar@cadence.com \
--cc=jszhang@kernel.org \
--cc=konrad@cadence.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=pthombar@cadence.com \
--cc=stable@vger.kernel.org \
--cc=wsadowski@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox