spi: Only defer to thread for cleanup when needed
authorMark Brown <broonie@kernel.org>
Wed, 15 Jul 2020 16:36:10 +0000 (17:36 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 16 Jul 2020 23:55:23 +0000 (00:55 +0100)
commite126859729ed4a5143e5690186b8bec1c1157113
treee5af46301959fcc4461425477da4f6b0ca856b35
parent2ae3de10abfe0be40c9d93ebc2f429b969abf008
spi: Only defer to thread for cleanup when needed

Currently we always defer idling of controllers to the SPI thread, the goal
being to ensure that we're doing teardown that's not suitable for atomic
context in an appropriate context and to try to batch up more expensive
teardown operations when the system is under higher load, allowing more
work to be started before the SPI thread is scheduled. However when the
controller does not require any substantial work to idle there is no need
to do this, we can instead save the context switch and immediately mark
the controller as idle. This is particularly useful for systems where there
is frequent but not constant activity.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200715163610.9475-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c