All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "Srinivas Neeli" <sneeli@xilinx.com>,
	"Srinivas Goud" <sgoud@xilinx.com>,
	"Naveen Kumar Gaddipati" <naveenku@xilinx.com>,
	"Prasad Beer Prasad" <prasadbe@xilinx.com>,
	linux-can <linux-can@vger.kernel.org>,
	"Stefan Mätje" <Stefan.Maetje@esd.eu>
Subject: Re: Queries on CAN frame work
Date: Fri, 14 Jan 2022 19:16:02 +0900	[thread overview]
Message-ID: <CAMZ6RqJTO8X+YZBb5g0WjObeB=oR1QzguazahsBhJOTz5+1MoQ@mail.gmail.com> (raw)
In-Reply-To: <20220113211018.tqddyiix3vy5q3eq@pengutronix.de>

Le ven. 14 janv. 2022 à 06:10, Marc Kleine-Budde <mkl@pengutronix.de> a écrit :
>
> On 13.01.2022 21:30:04, Marc Kleine-Budde wrote:
> > > Recently we did few experiments with our CANFD network. Stuff error
> > > observed with different Nominal and Dataphase prescaler configuration
> > > values, which we get from the frame work.
> > >
> > > For lower baud rates separate prescalers are working good, but when we
> > > switch to high baud rates(like 4Mbps and 5Mbps) observed the BUSOFF
> > > state(Due to stuff errors) on IP(Xilinx).
> > >
> > > With shared prescaler(low prescalers) we are not seeing the issue..
> > >
> > > In Iso spec also mentioned to avoid tolerance, we have to maintain
> > > common TQ for Nominal and Data phase.
>
> This is a known problem with the current arbitration and data bit rate
> calculation. They are done independently of each other, resulting in not
> common pre-scalers and thus not common TQ.
>
> > > Spec: ISO 11898-1:2015(E)  page no :50
> > >
> > > " If the same time quantum length is used in the nominal bit time and
> > > in the data bit time and the positions of the sample points in the
> > > nominal bit time are the same in all CAN nodes of a network, then
> > > optimum clock tolerance is accomplished for networks using FD frames."
> > >
> > > CIA:
> > > https://can-newsletter.org/uploads/media/raw/f6a36d1461371a2f86ef0011a513712c.pdf
> > >
> > > From above CAN-newsletter also suggested the same in recommendation 2 and 3.
>
> I'll have a look at the newsletter and see what changes need to be done
> to the existing algorithm.
>
> > > Recommendation 2: Set the BRPA bit-rate prescaler equal BRPB
> > > Recommendation 3: Choose BRPA and BRPD as low as possible
> > >
> > > Is there any possibility in framework to use shared prescalars for
> > > Nominal and Dataphase?.
>
> Not yet.

Well, technically, skipping the full calculation and providing all
bittiming parameters will allow you to use shared prescalers. But
indeed, there is nothing to automatically calculate it nor to check the
sanity of manually provided bittiming parameters.

> > > One more question. How to calculate TDCO ?, is there any generic
> > > formula for this ?.
>
> Vincent (Cc'ed) can help you on this.

It is implemented in the kernel here:
https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev/bittiming.c#L178

You can refer to the patch description for additional info.
 * Original patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c25cc7993243fdc00ab7e608e3764819538015ab
 * Amended by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39f66c9e229797a58a12ea78388cbbad1f81aec9

N.B.: the comments of the original patch related to iproute2 are outdated.

If you follow the links in the patches you will find even more discussions
on this topic in the mailing list archives. But I guess that the commit
description is enough to answer your questions.

Also, please note that the xilinx driver does not yet implement TDC.
Actually, TDC netlink framework was introduced recently in the kernel and
as of today only the etas_es58x does support it.

By the way, Marc, did you get an answer from Microchip on the relative
TDCO topic for the mcp25xxfd?
c.f. https://lore.kernel.org/all/20210817094306.iyezzml6m7nlznri@pengutronix.de/


Yours sincerely,
Vincent Mailhol

  reply	other threads:[~2022-01-14 10:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DM6PR02MB538645C4ECE3BBBD3CE92A17AF539@DM6PR02MB5386.namprd02.prod.outlook.com>
2022-01-13 20:30 ` Queries on CAN frame work Marc Kleine-Budde
2022-01-13 21:10   ` Marc Kleine-Budde
2022-01-14 10:16     ` Vincent MAILHOL [this message]
2022-01-17 11:48       ` Marc Kleine-Budde
2022-01-15 23:26     ` Marc Kleine-Budde
2022-02-21 14:43       ` Srinivas Neeli
2022-02-21 20:27         ` Marc Kleine-Budde
2022-02-22  0:40           ` Srinivas Neeli
2022-03-06 14:30             ` Srinivas Neeli
2022-03-06 14:47               ` Marc Kleine-Budde
2022-03-17 22:00         ` Marc Kleine-Budde
2022-03-18  6:12           ` Srinivas Neeli
2022-03-18  8:30             ` Marc Kleine-Budde
2022-03-18  9:54               ` Srinivas Neeli
2022-03-18 10:01                 ` Marc Kleine-Budde
2022-03-17 22:50         ` Marc Kleine-Budde
2022-03-18  6:55           ` Srinivas Neeli
2022-03-18  9:15             ` Marc Kleine-Budde
2022-03-18 10:15               ` Srinivas Neeli
2022-03-18 12:03                 ` Marc Kleine-Budde
2022-03-18 13:57               ` 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='CAMZ6RqJTO8X+YZBb5g0WjObeB=oR1QzguazahsBhJOTz5+1MoQ@mail.gmail.com' \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=Stefan.Maetje@esd.eu \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=naveenku@xilinx.com \
    --cc=prasadbe@xilinx.com \
    --cc=sgoud@xilinx.com \
    --cc=sneeli@xilinx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.