From 2b3cef0fc757bd06ed9b83bd4c436bfa55f47370 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Wed, 9 Sep 2020 17:28:52 -0500 Subject: [PATCH] spi: fsi: Handle 9 to 15 byte transfers lengths The trailing - 8 bytes of transfer data in this size range is no longer ignored. Fixes: bbb6b2f9865b ("spi: Add FSI-attached SPI controller driver") Signed-off-by: Brad Bishop Signed-off-by: Eddie James Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20200909222857.28653-2-eajames@linux.ibm.com Signed-off-by: Mark Brown --- drivers/spi/spi-fsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c index 37a3e0f..8f64af0 100644 --- a/drivers/spi/spi-fsi.c +++ b/drivers/spi/spi-fsi.c @@ -258,15 +258,15 @@ static int fsi_spi_sequence_transfer(struct fsi_spi *ctx, if (loops > 1) { fsi_spi_sequence_add(seq, SPI_FSI_SEQUENCE_BRANCH(idx)); - if (rem) - fsi_spi_sequence_add(seq, rem); - rc = fsi_spi_write_reg(ctx, SPI_FSI_COUNTER_CFG, SPI_FSI_COUNTER_CFG_LOOPS(loops - 1)); if (rc) return rc; } + if (rem) + fsi_spi_sequence_add(seq, rem); + return 0; } -- 2.7.4