[lkml]   [2022]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 5.15 010/230] can: m_can: m_can_chip_config(): actually enable internal timestamping
From: Marc Kleine-Budde <>

commit 5b12933de4e76ec164031c18ce8e0904abf530d7 upstream.

In commit df06fd678260 ("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.

Fixes: df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps")
Cc: <> # 5.13
Cc: Torin Cooper-Bennun <>
Reviewed-by: Chandrasekar Ramakrishnan <>
Signed-off-by: Marc Kleine-Budde <>
Signed-off-by: Greg Kroah-Hartman <>
drivers/net/can/m_can/m_can.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1367,7 +1367,9 @@ static void m_can_chip_config(struct net
/* enable internal timestamp generation, with a prescalar of 16. The
* prescalar is applied to the nominal bit timing
- m_can_write(cdev, M_CAN_TSCC, FIELD_PREP(TSCC_TCP_MASK, 0xf));
+ m_can_write(cdev, M_CAN_TSCC,

m_can_config_endisable(cdev, false);

 \ /
  Last update: 2022-07-11 11:43    [W:0.493 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site