All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Sekhar Nori" <nsekhar@ti.com>,
	"Franklin S Cooper Jr" <fcooper@ti.com>,
	"Mario Hüttel" <mario.huettel@gmx.net>,
	"Yang, Wenyou" <Wenyou.Yang@Microchip.com>,
	wg@grandegger.com, socketcan@hartkopp.net,
	quentin.schulz@free-electrons.com, edumazet@google.com,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Wenyou Yang <wenyou.yang@atmel.com>,
	Dong Aisheng <b29396@freescale.com>,
	"Quadros, Roger" <rogerq@ti.com>
Subject: Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates
Date: Thu, 19 Oct 2017 11:13:57 +0200	[thread overview]
Message-ID: <545ac690-10c8-b206-76dd-dbbe602eb6af@pengutronix.de> (raw)
In-Reply-To: <93c6d531-c38b-6f88-510f-59eb3e733b78@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 3942 bytes --]

On 10/19/2017 07:07 AM, Sekhar Nori wrote:
>>>> Sounds reasonable. What's the status of this series?
>>>
>>> I have had some offline discussions with Franklin on this, and I am not
>>> fully convinced that DT is the way to go here (although I don't have the
>>> agreement with Franklin there).
>>
>> Probably the fundamental area where we disagree is what "default" SSP
>> value should be used. Based on a short (< 1 ft) point to point test
>> using a SSP of 50% worked fine. However, I'm not convinced that this
>> default value of 50% will work in a more "traditional" CAN bus at higher
>> speeds. Nor am I convinced that a SSP of 50% will work on every MCAN
>> board in even the simplest test cases.
>>
>> I believe that this default SSP should be a DT property that allows any
>> board to determine what default value works best in general.
> 
> With that, I think, we are taking DT from describing board/hardware
> characteristics to providing default values that software should use.

If the default value is board specific and cannot be calculated in
general or from other values present in the DT, then it's from my point
of view describing the hardware.

> In any case, if Marc and/or Wolfgang are okay with it, binding
> documentation for such a property should be sent to DT maintainers for
> review.
> 
>>>
>>> There are two components in configuring the secondary sample point. It
>>> is the transceiver loopback delay and an offset (example half of the bit
>>> time in data phase).
>>>
>>> While the transceiver loopback delay is pretty board dependent (and thus
>>> amenable to DT encoding), I am not quite sure the offset can be
>>> configured in DT because its not really board dependent.
>>>
>>> Unfortunately, offset calculation does not seem to be an exact science.
>>> There are recommendations ranging from using 50% of bit time to making
>>> it same as the sample point configured. This means users who need to
>>> change the SSP due to offset variations need to change  their DT even
>>> without anything changing on their board.
>>>
>>> Since we have a netlink socket interface to configure sample point, I
>>> wonder if that should be extended to configure SSP too (or at least the
>>> offset part of SSP)?
>>
>> Sekhar is right that ideally the user should be able to set the SSP at
>> runtime. However, my issue is that based on my experience CAN users
>> expect the driver to just work the majority of times. For unique use
>> cases where the driver calculated values don't work then the user should
>> be able to override it. This should only be done for a very small
>> percentage of CAN users. Unless you allow DT to provide a default SSP
>> many users of MCAN may find that the default SSP doesn't work and must
>> always use runtime overrides to get anything to work. I don't think that
>> is a good user experience which is why I don't like the idea.
> 
> Fair enough. But not quite sure if CAN users expect CAN-FD to "just
> work" without doing any bittiming related setup.

From my point of view I'd rather buy a board from a HW vendor where
CAN-FD works, rather than a board where I have to tweak the bit-timing
for a simple CAN-FD test setup.

As far as I see for the m_can driver it's a single tuple: "bitrate > 2.5
MBit/s -> 50%". Do we need an array of tuples in general?

If good default values are transceiver and board specific, they can go
into the DT. We need a generic (this means driver agnostic) binding for
this. If this table needs to be tweaked for special purpose, then we can
add a netlink interface for this as well.

Comments?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2017-10-19  9:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 19:39 [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates Franklin S Cooper Jr
2017-08-18 19:39 ` Franklin S Cooper Jr
2017-09-13 21:58 ` Franklin S Cooper Jr
2017-09-13 21:58   ` Franklin S Cooper Jr
2017-09-14  5:06   ` Sekhar Nori
2017-09-14  5:06     ` Sekhar Nori
2017-09-18  3:47     ` Yang, Wenyou
2017-09-18  3:47       ` Yang, Wenyou
2017-09-20 20:19       ` Franklin S Cooper Jr
2017-09-20 20:19         ` Franklin S Cooper Jr
2017-09-20 21:37         ` Mario Hüttel
2017-09-21  0:48           ` Franklin S Cooper Jr
2017-10-18 12:44             ` Marc Kleine-Budde
2017-10-18 13:24               ` Sekhar Nori
2017-10-18 14:17                 ` Franklin S Cooper Jr
2017-10-19  5:07                   ` Sekhar Nori
2017-10-19  9:13                     ` Marc Kleine-Budde [this message]
2017-10-19 11:09                       ` Sekhar Nori
2017-10-19 11:32                         ` Marc Kleine-Budde
2017-10-19 13:54                           ` Franklin S Cooper Jr
2017-10-19 14:55                             ` Marc Kleine-Budde
2017-10-19 15:40                               ` Franklin S Cooper Jr
2017-10-20 12:14                               ` Sekhar Nori
2017-10-20 12:14                                 ` Sekhar Nori
2017-10-19 11:14                       ` Oliver Hartkopp
2017-10-19 11:26                         ` Marc Kleine-Budde
2017-10-19 18:35                           ` Oliver Hartkopp
2017-10-19 19:54                             ` Mario Hüttel
2017-10-19 20:17                               ` Oliver Hartkopp
2017-10-19  8:04                 ` Ramesh Shanmugasundaram
2017-10-19  9:21                   ` 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=545ac690-10c8-b206-76dd-dbbe602eb6af@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Wenyou.Yang@Microchip.com \
    --cc=b29396@freescale.com \
    --cc=edumazet@google.com \
    --cc=fcooper@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.huettel@gmx.net \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=rogerq@ti.com \
    --cc=socketcan@hartkopp.net \
    --cc=wenyou.yang@atmel.com \
    --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 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.