diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2020-03-05 00:00:39 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-05 14:06:19 +0000 |
commit | 6a726824aaa3adaaf3bcfca3b471408e225f33d6 (patch) | |
tree | 03b5082efe1f52af591a5d0f54cc050794cba65b /include/linux/spi | |
parent | a3185c38dc6cd664b2b576eb9d3e5d2f49101a10 (diff) |
spi: Do spi_take_timestamp_pre for as many times as necessary
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: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20200304220044.11193-8-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 600e3793303e..87105272879b 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -933,8 +933,7 @@ struct spi_transfer { struct ptp_system_timestamp *ptp_sts; - bool timestamped_pre; - bool timestamped_post; + bool timestamped; struct list_head transfer_list; }; |