diff options
author | David Lechner <dlechner@baylibre.com> | 2024-02-19 16:33:21 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-02-26 13:55:12 +0000 |
commit | 7dba2adb063bcf7a293eacb88980e0975b1fb1fd (patch) | |
tree | ad308f46ee9df62f0c201a25b918ccb94088f778 /.gitattributes | |
parent | c2bcfe7c6edf418d5adf731a7d60a8abd81e952f (diff) |
spi: axi-spi-engine: move message compile to optimize_message
In the AXI SPI Engine driver, compiling the message is an expensive
operation. Previously, it was done per message transfer in the
prepare_message hook. This patch moves the message compile to the
optimize_message hook so that it is only done once per message in
cases where the peripheral driver calls spi_optimize_message().
This can be a significant performance improvement for some peripherals.
For example, the ad7380 driver saw a 13% improvement in throughput
when using the AXI SPI Engine driver with this patch.
Since we now need two message states, one for the optimization stage
that doesn't change for the lifetime of the message and one that is
reset on each transfer for managing the current transfer state, the old
msg->state is split into msg->opt_state and spi_engine->msg_state. The
latter is included in the driver struct now since there is only one
current message at a time that can ever use it and it is in a hot path
so avoiding allocating a new one on each message transfer saves a few
cpu cycles and lets us get rid of the prepare_message callback.
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://msgid.link/r/20240219-mainline-spi-precook-message-v2-4-4a762c6701b9@baylibre.com
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions