Linux CAN drivers development
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Binbin Zhou <zhoubb.aaron@gmail.com>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
	Huacai Chen <chenhuacai@loongson.cn>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Bingxiong Li <libingxiong@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>,
	Xuerui Wang <kernel@xen0n.name>,
	loongarch@lists.linux.dev, linux-can@vger.kernel.org,
	jeffbai@aosc.io
Subject: Re: [PATCH 1/2] can: Add Loongson CAN-FD controller support
Date: Tue, 26 May 2026 17:57:55 +0200	[thread overview]
Message-ID: <6ea756bf-d776-4eff-b0ca-eeaa6737e035@kernel.org> (raw)
In-Reply-To: <CAMpQs4K5Q_vC=wnGp3gf=F5RU8t61PLh4dLEmcLMMbM4mR+Wnw@mail.gmail.com>

On 21/05/2026 at 05:24, Binbin Zhou wrote:
> Hi Vincent:
> 
> On Thu, May 7, 2026 at 1:50 AM Vincent Mailhol <mailhol@kernel.org> wrote:

(...)

>> Use the CAN TDC framework to get the SSP value (c.f. struct can_tdc,
>> struct can_tdc_const and can_fd_tdc_is_enabled())
> 
> Last question:
> 
> In the general framework, the calculation condition for tdco is
> (dbt->brp == 1 || dbt->brp == 2), which does not seem to correspond to
> the current condition (dbt->bitrate > 1000000).

Where does the current condition comes from? Is it some empirical test?

FYI, the

  (dbt->brp == 1 || dbt->brp == 2)

check comes from ISO 11898.

> Although for CANFD, rates below 1 Mbit/s would negate the primary
> advantages of FD, from a controller hardware design perspective, I
> would still prefer to retain the condition (dbt->bitrate > 1000000).
> 
> Do you have any other suggestions?

Using TDC on low bitrates is indeed unstable and can lead to bus errors.
But the condition which you suggest

  (dbt->bitrate > 1000000)

is indirectly linked with the brp values. That's why the brp check is
sufficient (and more precise than the empirical 1 Mbit/s threshold value).

Are you able to trigger any bus errors when using TDC with a brp value
of 1 or 2 and a bitrate below 1 Mbit/sec? If no, there is no reason to
add this extra check and we can continue to rely on the framework test.


Yours sincerely,
Vincent Mailhol


  reply	other threads:[~2026-05-26 15:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  7:17 [PATCH 0/2] Add Loongson CAN-FD controller driver Binbin Zhou
2026-04-27  7:17 ` [PATCH 1/2] can: Add Loongson CAN-FD controller support Binbin Zhou
2026-05-06 17:50   ` Vincent Mailhol
2026-05-12  7:24     ` Binbin Zhou
2026-05-15 12:27       ` Vincent Mailhol
2026-05-18  8:12         ` Binbin Zhou
2026-05-18  9:18         ` Binbin Zhou
2026-05-21  3:24     ` Binbin Zhou
2026-05-26 15:57       ` Vincent Mailhol [this message]
2026-04-27  7:18 ` [PATCH 2/2] can: loongson_canfd: Add RXDMA support Binbin Zhou
2026-05-06 17:51   ` Vincent Mailhol
2026-05-12 10:06     ` Binbin Zhou

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=6ea756bf-d776-4eff-b0ca-eeaa6737e035@kernel.org \
    --to=mailhol@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=jeffbai@aosc.io \
    --cc=kernel@xen0n.name \
    --cc=libingxiong@loongson.cn \
    --cc=linux-can@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mkl@pengutronix.de \
    --cc=zhoubb.aaron@gmail.com \
    --cc=zhoubinbin@loongson.cn \
    /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