Skip to content

Commit 5b12933

Browse files
can: m_can: m_can_chip_config(): actually enable internal timestamping
In commit df06fd6 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") the timestamping in the m_can core should be enabled. In peripheral mode, the RX'ed CAN frames, TX compete frames and error events are sorted by the timestamp. The above mentioned commit however forgot to enable the timestamping. Add the missing bits to enable the timestamp counter to the write of the Timestamp Counter Configuration register. Link: https://lore.kernel.org/all/[email protected] Fixes: df06fd6 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") Cc: <[email protected]> # 5.13 Cc: Torin Cooper-Bennun <[email protected]> Reviewed-by: Chandrasekar Ramakrishnan <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 562fed9 commit 5b12933

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,9 @@ static void m_can_chip_config(struct net_device *dev)
13511351
/* enable internal timestamp generation, with a prescalar of 16. The
13521352
* prescalar is applied to the nominal bit timing
13531353
*/
1354-
m_can_write(cdev, M_CAN_TSCC, FIELD_PREP(TSCC_TCP_MASK, 0xf));
1354+
m_can_write(cdev, M_CAN_TSCC,
1355+
FIELD_PREP(TSCC_TCP_MASK, 0xf) |
1356+
FIELD_PREP(TSCC_TSS_MASK, TSCC_TSS_INTERNAL));
13551357

13561358
m_can_config_endisable(cdev, false);
13571359

0 commit comments

Comments
 (0)