From: David Jander <david@protonic.nl>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: wg@grandegger.com, linux-can@vger.kernel.org
Subject: Re: [PATCH 2/3] can: flexcan.c: Re-write receive path to use MB queue instead of FIFO
Date: Wed, 3 Sep 2014 09:19:54 +0200 [thread overview]
Message-ID: <20140903091954.611e527e@archvile> (raw)
In-Reply-To: <5405D9FA.6050207@pengutronix.de>
On Tue, 02 Sep 2014 16:53:46 +0200
Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 09/02/2014 02:04 PM, David Jander wrote:
> > On Tue, 02 Sep 2014 13:30:24 +0200
> > Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> >
> >> On 08/27/2014 11:58 AM, David Jander wrote:
> >>> The FlexCAN controller has a RX FIFO that is only 6 messages deep, and a
> >>> mailbox space capable of holding up to 63 messages.
> >>> This space was largely unused, limiting the permissible latency from
> >>> interrupt to NAPI to only 6 messages. This patch uses all available MBs
> >>> for message reception and frees the MBs in the IRQ handler to greatly
> >>> decrease the likelihood of receive overruns.
> >>
> >> What about the order of the incoming CAN frames? Is it still preserved?
> >
> > Yes, it is preserved as long as latency doesn't exceed 30 frames, which is
> > way more than the original driver could take. The algorithm is not trivial,
> > therefor I included an explanatory comment to flexcan_copy_rxmbs().
>
> To be honest, I haven't looked at the algorithm in detail. I think we
> first have to fix both bugs (the errata and the mailbox initialization
> issue).
Ok, I agree.
> >> You make use of the CTRL2 register, which is not present on some older
> >> (but supported) flexcan IP cores. You increase FLEXCAN_MCR_MAXMB to
> >> 0x40, which is not supported on older IPs. The register rximr, is also
> >> not present on older cores. Don't break support for the older CAN cores.
> >
> > Oops. Thanks for pointing that out. I will check the reference manual of
> > the i.MX53 (which should have be the oldest supported version of this IP
> > core, right?). Of course I do not want to break older CAN cores.
> > I will check correctness testing the code on an i.MX28 board which I have.
>
> Regarding the versions of the IP cores, we should not trust them, as
> they are not public available..
Ok. I fear that for this last patch we will need some run-time check for the
version of the flexcan we have. I suppose the typical table with OF ids and
flags will do?
Best regards,
--
David Jander
Protonic Holland.
next prev parent reply other threads:[~2014-09-03 7:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 9:58 [PATCH 0/3] Decrease likelyhood of RX overruns David Jander
2014-08-27 9:58 ` [PATCH 1/3] can: flexcan.c: Correctly initialize mailboxes David Jander
2014-09-02 10:24 ` Marc Kleine-Budde
2014-09-02 10:37 ` David Jander
2014-09-02 10:59 ` Marc Kleine-Budde
2014-09-02 11:15 ` David Jander
2014-09-02 13:54 ` Marc Kleine-Budde
2014-09-02 14:27 ` David Jander
2014-09-02 11:32 ` David Jander
2014-09-02 11:38 ` Marc Kleine-Budde
2014-09-02 14:53 ` Marc Kleine-Budde
2014-08-27 9:58 ` [PATCH 2/3] can: flexcan.c: Re-write receive path to use MB queue instead of FIFO David Jander
2014-09-02 11:30 ` Marc Kleine-Budde
2014-09-02 12:04 ` David Jander
2014-09-02 14:53 ` Marc Kleine-Budde
2014-09-03 7:19 ` David Jander [this message]
2014-09-03 9:12 ` Marc Kleine-Budde
2014-09-03 15:42 ` David Jander
2014-08-27 9:58 ` [PATCH 3/3] can: flexcan.c: Implement last step of workaround for errata ERR005829 David Jander
2014-09-02 11:28 ` Marc Kleine-Budde
2014-09-02 11:36 ` David Jander
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=20140903091954.611e527e@archvile \
--to=david@protonic.nl \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).