linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Mätje" <Stefan.Maetje@esd.eu>
To: "mailhol.vincent@wanadoo.fr" <mailhol.vincent@wanadoo.fr>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>
Subject: Re: [RFC PATCH v4 3/4] iplink_can: print brp and dbrp bittiming variables
Date: Mon, 9 Aug 2021 12:27:22 +0000	[thread overview]
Message-ID: <ef0300efaf54edb82918ded0ef61f1f838e777eb.camel@esd.eu> (raw)
In-Reply-To: <CAMZ6RqKyL81CK_U9K-NZ4sNCLt8bKVWZ8mhcPd=p=cVHMO5RjQ@mail.gmail.com>

Am Freitag, den 09.07.2021, 14:17 +0200 schrieb Vincent MAILHOL:
> On Wed. 7 Jul 2021 at 18:33, Stefan Mätje <Stefan.Maetje@esd.eu> wrote:
> > Am Dienstag, den 29.06.2021, 00:44 +0900 schrieb Vincent Mailhol:
> > > Report the value of the bit-rate prescaler (brp) for both the nominal
> > > and the data bittiming.
> > > 
> > > Currently, only the constant brp values (brp_{min,max,inc}) are being
> > > reported. Also, brp is the only member of struct can_bittiming not
> > > being reported.
> > > 
> > > Although brp is not used as an input for bittiming calculation, it
> > > makes sense to output it.
> > > 
> > > Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> > 
> > I think it is a good idea to display both brp and dbrp values because it makes
> > the displayed bitrate settings complete. Even if it could be calculated from the
> > displayed clock and tq values.
> 
> Your remark is true. I also realized that BRP can be calculated
> from the other parameters but because I am lazy, I like to have
> it reported so I wrote this patch. I will add a note in the patch
> comments to reflect that this value could be calculated by hand.

A late comment on this ...

I didn't mean in any way that the BRP value should not be shown because it 
could be calculated from the other displayed values.

But I'm happy with this change because the CAN clock, BRP, prop seg and 
tsegX values are the input parameters for the CAN bitrate configuration.
These are the "real" parameters.

The tq length and bitrate are only "derived" or calculated values. These
values underlie rounding and truncation effects and are therefore less
"worth" for the description of the bitrate configuration.

Therefore its my opinion its better to have the "real" input values be
shown from where all other values can be derived.

Best regards,
    Stefan


  reply	other threads:[~2021-08-09 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 15:43 [RFC PATCH v4 0/4] iplink_can: cleaning, fixes and adding TDC support Vincent Mailhol
2021-06-28 15:43 ` [RFC PATCH v4 1/4] iplink_can: fix configuration ranges in print_usage() Vincent Mailhol
2021-06-28 15:44 ` [RFC PATCH v4 2/4] iplink_can: use PRINT_ANY to factorize code and fix signedness Vincent Mailhol
2021-06-28 15:44 ` [RFC PATCH v4 3/4] iplink_can: print brp and dbrp bittiming variables Vincent Mailhol
2021-07-07 16:33   ` Stefan Mätje
2021-07-09 12:17     ` Vincent MAILHOL
2021-08-09 12:27       ` Stefan Mätje [this message]
2021-06-28 15:44 ` [RFC PATCH v4 4/4] iplink_can: add new CAN FD bittiming parameters: Transmitter Delay Compensation (TDC) Vincent Mailhol
2021-07-07 16:21   ` Stefan Mätje
2021-07-09 13:32     ` Vincent MAILHOL
2021-08-09 14:44       ` Stefan Mätje
2021-08-14  9:51         ` Vincent MAILHOL

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=ef0300efaf54edb82918ded0ef61f1f838e777eb.camel@esd.eu \
    --to=stefan.maetje@esd.eu \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).