From: Tomas Alvarez Vanoli Date: Tue, 24 Mar 2026 17:02:12 +0000 (+0100) Subject: spi: fsl_espi: fix din offset X-Git-Tag: v2026.07-rc1~21^2~28^2~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7917c2e35604;p=thirdparty%2Fu-boot.git spi: fsl_espi: fix din offset In the case of SPI_XFER_BEGIN | SPI_XFER_END, the function creates a buffer of double the size of the transaction, so that it can write the data in into the second half. It sets the rx_offset to len, and in the while loop we are setting an internal "din" to buffer + rx_offset. However, at the end of each loop, the driver copies "buffer + 2 * cmd_len" back to the data_in pointer. This commit changes the source of the data to buffer + rx_offset. Signed-off-by: Tomas Alvarez Vanoli --- diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index 7ed35aa3e66..117e36376b7 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -275,7 +275,7 @@ int espi_xfer(struct fsl_spi_slave *fsl, uint cs, unsigned int bitlen, } } if (data_in) { - memcpy(data_in, buffer + 2 * cmd_len, tran_len); + memcpy(data_in, buffer + rx_offset, tran_len); if (*buffer == 0x0b) { data_in += tran_len; data_len -= tran_len;