]> 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)
commit5ec33564cf31d07eab095f97f4dd9a52d19b0840
treeebed1832afaefa093f7eff130052a59cf7f34bec
parent91d781de7f6b0ccb5ce7bb2ec6dd6b1e51b7b702
parentfe2dcac630b2df5403f41b9caeb2ba4f03e243b0
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.