]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Don't look at TX buffer for PTP system timestamping
authorVladimir Oltean <olteanv@gmail.com>
Fri, 27 Dec 2019 01:24:17 +0000 (03:24 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 27 Dec 2019 23:03:43 +0000 (23:03 +0000)
commit862dd2a946aa1417f013fb748e2aa0f4349b405b
tree8710c9f5a8d6899b3f0d9e931fa7a43b2898e2dd
parent9cd34efbd3012171c102910ce17ee632a3cccb44
spi: Don't look at TX buffer for PTP system timestamping

The API for PTP system timestamping (associating a SPI transaction with
the system time at which it was transferred) is flawed: it assumes that
the xfer->tx_buf pointer will always be present.

This is, of course, not always the case.

So introduce a "progress" variable that denotes how many word have been
transferred.

Fix the Freescale DSPI driver, the only user of the API so far, in the
same patch.

Fixes: b42faeee718c ("spi: Add a PTP system timestamp to the transfer structure")
Fixes: d6b71dfaeeba ("spi: spi-fsl-dspi: Implement the PTP system timestamping for TCFQ mode")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20191227012417.1057-1-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi.c
include/linux/spi/spi.h