diff options
| author | David Lechner <[email protected]> | 2024-07-23 18:36:47 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2024-07-29 00:23:21 +0000 |
| commit | f8918ef1267edab4d9b2154c22a912c87cc66f66 (patch) | |
| tree | 8623fbdc1dbf213f9f2cbc240ae86ed00a29b628 /drivers/spi/spi-axi-spi-engine.c | |
| parent | Linux 6.11-rc1 (diff) | |
| download | kernel-f8918ef1267edab4d9b2154c22a912c87cc66f66.tar.gz kernel-f8918ef1267edab4d9b2154c22a912c87cc66f66.zip | |
spi: axi-spi-engine: don't emit XFER_BITS for empty xfer
This adds a check on xfer->len to avoid emitting an XFER_BITS
instruction for empty transfers in the AXI SPI Engine driver. This
avoids unnecessary delays caused by executing an instruction that has
no effect on the actual SPI transfer.
Signed-off-by: David Lechner <[email protected]>
Reviewed-by: Nuno Sa <[email protected]>
Link: https://patch.msgid.link/20240723-spi-axi-spi-engine-opt-bpw-v1-1-2625ba4c4387@baylibre.com
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/spi/spi-axi-spi-engine.c')
| -rw-r--r-- | drivers/spi/spi-axi-spi-engine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c index 447e5a962dee..cb3fdcbca2be 100644 --- a/drivers/spi/spi-axi-spi-engine.c +++ b/drivers/spi/spi-axi-spi-engine.c @@ -258,7 +258,7 @@ static void spi_engine_compile_message(struct spi_message *msg, bool dry, clk_div - 1)); } - if (bits_per_word != xfer->bits_per_word) { + if (bits_per_word != xfer->bits_per_word && xfer->len) { bits_per_word = xfer->bits_per_word; spi_engine_program_add_cmd(p, dry, SPI_ENGINE_CMD_WRITE(SPI_ENGINE_CMD_REG_XFER_BITS, |
