• Vladimir Oltean's avatar
    spi: spi-fsl-dspi: Take software timestamp in dspi_fifo_write · e9bac900
    Vladimir Oltean authored
    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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Link: https://lore.kernel.org/r/20200304220044.11193-13-olteanv@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    e9bac900
spi-fsl-dspi.c 35.7 KB