spi: axi-spi-engine: remove use of ida for sync id
authorDavid Lechner <dlechner@baylibre.com>
Wed, 7 Feb 2024 14:51:24 +0000 (08:51 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 7 Feb 2024 15:17:42 +0000 (15:17 +0000)
commit531860e12da76a444e0ecfd37a9d786e7986957a
treee95ab3d6a0f9e4d7513fcc6b2a8ba9574407f98c
parentc0c0293cf7a0f21ef461956d44e4add718574f3f
spi: axi-spi-engine: remove use of ida for sync id

Profiling has shown that ida_alloc_range() accounts for about 10% of the
time spent in spi_sync() when using the AXI SPI Engine controller. This
call is used to create a unique id for each SPI message to match to an
IRQ when the message is complete.

Since the core SPI code serializes messages in a message queue, we can
only have one message in flight at a time, namely host->cur_msg. This
means that we can use a fixed value instead of a unique id for each
message since there can never be more than one message pending at a
time.

This patch removes the use of ida for the sync id and replaces it with a
constant value. This simplifies the driver and improves performance.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240207-axi-spi-engine-round-2-1-v2-1-40c0b4e85352@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-axi-spi-engine.c