diff mbox series

spi: axi-spi-engine: don't emit XFER_BITS for empty xfer

Message ID 20240723-spi-axi-spi-engine-opt-bpw-v1-1-2625ba4c4387@baylibre.com
State New
Headers show
Series spi: axi-spi-engine: don't emit XFER_BITS for empty xfer | expand

Commit Message

David Lechner July 23, 2024, 6:36 p.m. UTC
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 <dlechner@baylibre.com>
---
 drivers/spi/spi-axi-spi-engine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 67e899c7df7dd8507ab61a2e71fe6c8299afd427
change-id: 20240723-spi-axi-spi-engine-opt-bpw-e801253aa43a

Comments

Nuno Sá July 24, 2024, 7:45 a.m. UTC | #1
On Tue, 2024-07-23 at 13:36 -0500, David Lechner wrote:
> 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 <dlechner@baylibre.com>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Mark Brown July 29, 2024, 3:40 p.m. UTC | #2
On Tue, 23 Jul 2024 13:36:47 -0500, David Lechner wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: axi-spi-engine: don't emit XFER_BITS for empty xfer
      commit: f8918ef1267edab4d9b2154c22a912c87cc66f66

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

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,