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 1/3] can: flexcan.c: Correctly initialize mailboxes
Date: Tue, 2 Sep 2014 16:27:00 +0200 [thread overview]
Message-ID: <20140902162700.53555941@archvile> (raw)
In-Reply-To: <5405CBFE.5070207@pengutronix.de>
On Tue, 02 Sep 2014 15:54:06 +0200
Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 09/02/2014 01:15 PM, David Jander wrote:
>
> >> Yes, 0d1862e was not complete, the initialisation was fixes with:
> >>
> >> d5a7b40 can: flexcan: flexcan_chip_start: fix regression,
> >> mark one MB for TX and abort pending TX
> >>
> >> Which sets FLEXCAN_MCR_MAXMB to 8, which is the only mailbox used for tx
> >> and the code of the tx mailbox is set to 0x4 == tx, inactive.
> >>
> >> This should be enough in FIFO mode, correct?
> >
> > AFAICS not. There could still be other MB's with reception or transmission
> > enabled (randomly) causing potential data loss, extra frames sent and/or
> > errors in the statistics.
>
> > If the FIFO is full for example it should overflow with the next message,
> > but if the next message instead hits an (randomly) empty and readied RX MB
> > somewhere, the overflow is undetected and one (or more) frame(s) is lost.
>
> Is FIFO to normal mailbox overflow a new feature of the imx6 flexcan
> core? The mx35 data sheet states:
>
> > If the FIFO is full and more frames continue to be received, an
> > OVERFLOW interrupt is issued to the ARM and subsequent frames are not
> > accepted until the ARM creates space in the FIFO by reading one or
> > more frames.
>
> While the mx6 states:
>
> > Note that the flag will not be asserted when the Rx FIFO is
> > full and the message was captured by a Mailbox.
>
> But later in the imx35:
>
> > In the event that the FIFO is full, the matching algorithm always
> > looks for a matching message buffer outside the FIFO region.
>
> This probably means even on the mx35 the _FIFO_ does not accept any more
> message if it's full, but the other mailboxes may....
In the i.MX6 RM there's also this (Chapter 27.6.5 Matching Process):
> [...]
> If the FIFO is enabled, the priority of scanning can be selected between
> Mailboxes and FIFO filters. In any case, the matching starts from the lowest
> number Message Buffer toward the higher ones. If no match is found within
> the first structure then the other is scanned subsequently. In the event
> that the FIFO is full, the matching algorithm will always look for a
> matching MB outside the FIFO region.
What's not quite clear to me right now, is the function of MCR_MAXMB after
reading this. As far as I have observed, MCR_MAXMB is of no influence for
this. I needed to explicitely invalidate all remaining MB's to avoid flexcan
putting overflow messages there.
Best regards,
--
David Jander
Protonic Holland.
next prev parent reply other threads:[~2014-09-02 14:26 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 [this message]
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
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=20140902162700.53555941@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).