Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: fsi: Batch TX operations

Batch sequential write transfers up to the max TX size (40 bytes).
This controller must specify a max transfer size of only 8 bytes for
RX operations.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://patch.msgid.link/20250131200158.732898-1-eajames@linux.ibm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Eddie James and committed by
Mark Brown
652ffad1 26a756fc

+13
+13
drivers/spi/spi-fsi.c
··· 479 479 480 480 shift = SPI_FSI_SEQUENCE_SHIFT_IN(next->len); 481 481 fsi_spi_sequence_add(&seq, shift); 482 + } else if (next->tx_buf) { 483 + if ((next->len + transfer->len) > (SPI_FSI_MAX_TX_SIZE + 8)) { 484 + rc = -EINVAL; 485 + goto error; 486 + } 487 + 488 + len = next->len; 489 + while (len > 8) { 490 + fsi_spi_sequence_add(&seq, 491 + SPI_FSI_SEQUENCE_SHIFT_OUT(8)); 492 + len -= 8; 493 + } 494 + fsi_spi_sequence_add(&seq, SPI_FSI_SEQUENCE_SHIFT_OUT(len)); 482 495 } else { 483 496 next = NULL; 484 497 }