]> git.baikalelectronics.ru Git - kernel.git/commit
Optimize spi_sync path
authorMark Brown <broonie@kernel.org>
Tue, 28 Jun 2022 10:30:13 +0000 (11:30 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 28 Jun 2022 10:30:13 +0000 (11:30 +0100)
commit032a38857edae57206afc4c9912860bf9f7c48a8
treeebed1832afaefa093f7eff130052a59cf7f34bec
parent151df1c85f079f995f4a2470700a9d18660c4024
parentc699d7e0816d0600a56cb7995d0f78686be528a0
Optimize spi_sync path

Merge series from David Jander <david@protonic.nl>:

These patches optimize the spi_sync call for the common case that the
worker thread is idle and the queue is empty. It also opens the
possibility to potentially further optimize the async path also, since
it doesn't need to take into account the direct sync path anymore.

As an example for the performance gain, on an i.MX8MM SoC with a SPI CAN
controller attached (MCP2518FD), the time the interrupt line stays
active (which corresponds roughly with the time it takes to send 3
relatively short consecutive spi_sync messages) is reduced from 98us to
only 72us by this patch.

A note about message ordering:

This patch series should not change the behavior of message ordering when
coming from the same context. This means that if a client driver issues
one or more spi_async() messages immediately followed by a spi_sync()
message in the same context, it can still rely on these messages being
sent out in the order they were fired.