Skip to content

Commit

Permalink
spi: Catch improper use of PTP system timestamping API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Oltean authored and Mark Brown committed Dec 27, 2019
1 parent f03ee20 commit f971a20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,13 @@ void spi_finalize_current_message(struct spi_controller *ctlr)
}
}

if (unlikely(ctlr->ptp_sts_supported)) {
list_for_each_entry(xfer, &mesg->transfers, transfer_list) {
WARN_ON_ONCE(xfer->ptp_sts && !xfer->timestamped_pre);
WARN_ON_ONCE(xfer->ptp_sts && !xfer->timestamped_post);
}
}

spi_unmap_msg(ctlr, mesg);

if (ctlr->cur_msg_prepared && ctlr->unprepare_message) {
Expand Down

0 comments on commit f971a20

Please sign in to comment.