OSDN Git Service

spi: spi-fsl-dspi: Take software timestamp in dspi_fifo_write
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 4 Mar 2020 22:00:44 +0000 (00:00 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 5 Mar 2020 14:06:24 +0000 (14:06 +0000)
commite9bac90036d394b01cc7d5297a11d33b8ab92a91
tree61c6d289b2d49e4ad2e18c2f2887125654c727b0
parentea93ed4c181bd42d27b49b612d56f4ceb23d1d6c
spi: spi-fsl-dspi: Take software timestamp in dspi_fifo_write

Although the SPI system timestamps are supposed to reflect the moment
that the peripheral has received a word rather than the moment when the
CPU has enqueued that word to the FIFO, in practice it is easier to just
record the latter time than the former (with a smaller error).

With the recent migration of TCFQ users from poll back to interrupt mode
(this time for XSPI FIFO), it's wiser to keep the interrupt latency
outside of the measurement of the PTP system timestamp itself. If there
proves to be any constant offset that requires static compensation, that
can always be added later. So far that does not appear to be the case at
least on the LS1021A-TSN board, where testing shows that the phc2sys
offset is able to remain within +/- 200 ns even after 68 hours of
testing.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20200304220044.11193-13-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c