diff options
author | David Lechner <dlechner@baylibre.com> | 2024-02-07 15:51:25 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-02-07 16:17:43 +0100 |
commit | abb4b46c43689dd1f4d80c41e49127ca0ede75b3 (patch) | |
tree | 97c20574a1bf7197b5ee6121eb621de8de68506c /drivers/spi/spi-pic32-sqi.c | |
parent | spi: axi-spi-engine: remove use of ida for sync id (diff) | |
download | linux-abb4b46c43689dd1f4d80c41e49127ca0ede75b3.tar.xz linux-abb4b46c43689dd1f4d80c41e49127ca0ede75b3.zip |
spi: axi-spi-engine: move msg finalization out of irq handler
As a general principal, it is best to do as little as possible in an
interrupt handler. This patch reworks the AXI SPI Engine driver to move
timer_delete_sync() and spi_finalize_current_message() out of the
interrupt handler. Instead, spi_finalize_current_message() is moved to
the transfer_one_message function (similar to nearly all other SPI
controllers). A completion is now used to wait for the sync interrupt
that indicates that the message is complete. The watchdog timer is no
longer needed since we can use the wait_for_completion_timeout()
function to wait for the message to complete with the same effect.
As a bonus, these changes also improve throughput of the SPI controller.
For example, this was tested on a ZynqMP with a 80MHz SCLK reading 4
byte samples from an ADC. The max measured throughput increased from
26k to 28k samples per second.
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-2-40c0b4e85352@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pic32-sqi.c')
0 files changed, 0 insertions, 0 deletions