• Vladimir Oltean's avatar
    spi: Do spi_take_timestamp_pre for as many times as necessary · 6a726824
    Vladimir Oltean authored
    When dealing with a SPI controller driver that is sending more than 1
    byte at once (or the entire buffer at once), and the SPI peripheral
    driver has requested timestamping for a byte in the middle of the
    buffer, we find that spi_take_timestamp_pre never records a "pre"
    timestamp.
    
    This happens because the function currently expects to be called with
    the "progress" argument >= to what the peripheral has requested to be
    timestamped. But clearly there are cases when that isn't going to fly.
    
    And since we can't change the past when we realize that the opportunity
    to take a "pre" timestamp has just passed and there isn't going to be
    another one, the approach taken is to keep recording the "pre" timestamp
    on each call, overwriting the previously recorded one until the "post"
    timestamp is also taken.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Link: https://lore.kernel.org/r/20200304220044.11193-8-olteanv@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    6a726824
spi.c 110 KB