OSDN Git Service

spi: spi-geni-qcom: Don't wait to start 1st transfer if transmitting
authorDouglas Anderson <dianders@chromium.org>
Sat, 12 Sep 2020 18:17:25 +0000 (11:17 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 14 Sep 2020 14:50:16 +0000 (15:50 +0100)
commit6d66507d9b5507e26c5350d5a014b82c704124b8
treed52ced017bfd7776ca460345dbb126ad44328e58
parentcbd632ea8ee4ae07d12e85ed07aa5d667a1f47d8
spi: spi-geni-qcom: Don't wait to start 1st transfer if transmitting

If we're sending bytes over SPI, we know the FIFO is empty at the
start of the transfer.  There's no reason to wait for the interrupt
telling us to start--we can just start right away.  Then if we
transmit everything in one swell foop we don't even need to bother
listening for TX interrupts.

In a test of "flashrom -p ec -r /tmp/foo.bin" interrupts were reduced
from ~30560 to ~29730, about a 3% savings.

This patch looks bigger than it is because I moved a few functions
rather than adding a forward declaration.  The only actual change to
geni_spi_handle_tx() was to make it return a bool indicating if there
is more to tx.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Akash Asthana <akashast@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200912111716.1.Ied5e843fad0d6b733a1fb8bcfb364dd2fa889eb3@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-geni-qcom.c