]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-imx: mx51_ecspi_prepare_message(): skip writing MX51_ECSPI_CONFIG register...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 2 May 2022 17:54:57 +0000 (19:54 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 9 May 2022 17:18:16 +0000 (18:18 +0100)
commit865da8c80d48168a311b3fb51874de5503a36930
treebc8e030ca45bcab99bf61a66ae52b44ba1ddc5fc
parent3cd4c184989c23cd6d7456aeb538a3e3436fa9f2
spi: spi-imx: mx51_ecspi_prepare_message(): skip writing MX51_ECSPI_CONFIG register if unchanged

In mx51_ecspi_prepare_message() the MX51_ECSPI_CONFIG register is
setup for the current spi_message. After writing the register, there
is a delay to ensure that the changes hit the hardware.

This patch checks if the register MX51_ECSPI_CONFIG actually needs to
be changed. If the register content is unchanged the function is left
early, skipping the write to the hardware and the delay. This leads to
a small, but measurable performance increase. For a given workload
with small transfers on an imx6 single core the CPU load decreases
from 30% to ~27%.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/r/20220502175457.1977983-10-mkl@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-imx.c