From: Matej Vasilevski <matej.vasilevski@seznam.cz>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>,
Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>,
Wolfgang Grandegger <wg@grandegger.com>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
Martin Jerabek <martin.jerabek01@gmail.com>
Subject: Re: [PATCH] can: xilinx_can: add support for RX timestamps on Zynq
Date: Mon, 18 Jul 2022 12:40:03 +0200 [thread overview]
Message-ID: <20220718104003.GA35020@hopium> (raw)
In-Reply-To: <20220718083312.4izyuf7iawfbhlnf@pengutronix.de>
On Mon, Jul 18, 2022 at 10:33:12AM +0200, Marc Kleine-Budde wrote:
> On 16.07.2022 14:04:09, Matej Vasilevski wrote:
> > This patch adds support for hardware RX timestamps from Xilinx Zynq CAN
> > controllers. The timestamp is calculated against a timepoint reference
> > stored when the first CAN message is received.
> >
> > When CAN bus traffic does not contain long idle pauses (so that
> > the clocks would drift by a multiple of the counter rollover time),
> > then the hardware timestamps provide precise relative time between
> > received messages. This can be used e.g. for latency testing.
>
> Please make use of the existing cyclecounter/timecounter framework. Is
> there a way to read the current time from a register? If so, please
> setup a worker that does that regularly.
>
> Have a look at the mcp251xfd driver as an example:
>
> https://elixir.bootlin.com/linux/latest/source/drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c
Hi Marc,
as Pavel have said, the counter register isn't readable.
I'll try to fit the timecounter/cyclecounter framework and send a v2
patch if it works well. Thanks for the suggestion, it didn't occur to me
that I can use it in this case as well.
Regards,
Matej
next prev parent reply other threads:[~2022-07-18 10:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-16 12:04 [PATCH] can: xilinx_can: add support for RX timestamps on Zynq Matej Vasilevski
2022-07-18 8:33 ` Marc Kleine-Budde
2022-07-18 10:20 ` Pavel Pisa
2022-07-18 10:51 ` Marc Kleine-Budde
2022-07-18 10:40 ` Matej Vasilevski [this message]
2022-07-18 10:49 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220718104003.GA35020@hopium \
--to=matej.vasilevski@seznam.cz \
--cc=appana.durga.rao@xilinx.com \
--cc=linux-can@vger.kernel.org \
--cc=martin.jerabek01@gmail.com \
--cc=mkl@pengutronix.de \
--cc=naga.sureshkumar.relli@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox