Skip to content

Commit f971a20

Browse files
vladimirolteanbroonie
authored andcommitted
spi: Catch improper use of PTP system timestamping API
We can catch whether the SPI controller has declared it can take care of software timestamping transfers, but didn't. So do it. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Link: https://lore.kernel.org/r/20191227012444.1204-1-olteanv@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f03ee20 commit f971a20

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎drivers/spi/spi.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,13 @@ void spi_finalize_current_message(struct spi_controller *ctlr)
16801680
}
16811681
}
16821682

1683+
if (unlikely(ctlr->ptp_sts_supported)) {
1684+
list_for_each_entry(xfer, &mesg->transfers, transfer_list) {
1685+
WARN_ON_ONCE(xfer->ptp_sts && !xfer->timestamped_pre);
1686+
WARN_ON_ONCE(xfer->ptp_sts && !xfer->timestamped_post);
1687+
}
1688+
}
1689+
16831690
spi_unmap_msg(ctlr, mesg);
16841691

16851692
if (ctlr->cur_msg_prepared && ctlr->unprepare_message) {

0 commit comments

Comments
 (0)