All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: David Jander <david@protonic.nl>
Cc: wg@grandegger.com, linux-can@vger.kernel.org
Subject: Re: [PATCH 1/3] can: flexcan.c: Correctly initialize mailboxes
Date: Tue, 02 Sep 2014 12:59:42 +0200	[thread overview]
Message-ID: <5405A31E.1060403@pengutronix.de> (raw)
In-Reply-To: <20140902123725.01808f36@archvile>

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

On 09/02/2014 12:37 PM, David Jander wrote:
> On Tue, 02 Sep 2014 12:24:28 +0200
> Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> 
>> On 08/27/2014 11:58 AM, David Jander wrote:
>>> Apparently mailboxes may contain random data at startup, causing some of
>>> them being prepared for message reception. This causes overruns being
>>> missed or even confusing the IRQ check for trasmitted messages, increasing
>>> the transmit counter instead of the error counter.
>>>
>>> Signed-off-by: David Jander <david@protonic.nl>
>>
>> Before patch
>>
>> 0d1862e can: flexcan: fix flexcan_chip_start() on imx6
>>
>> there was a loop clearing the whole cantxfg register space. But this
>> turned out to be bogus, as message buffers 1...7 are reserved by the
>> FIFO engine and we're not allowed to tough them. This lead to some kind
>> of abort on imx6.
>>
>> You may need this patch once you don't make use of the FIFO engine any more.
> 
> You will need this patch in either case, but indeed, if you use the FIFO, you
> should skip the MB's that are shadowed by the FIFO.

ACK

> If you don't clear the rest of the MB's they may still contain random data and
> the problem remains.
> IMHO 0d1862e is wrong, since buffers are not in reset default values. There is
> no indication of that in the reference manual, and I have observed that they
> are indeed not cleared after reset.

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?

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: 181 bytes --]

  reply	other threads:[~2014-09-02 10:59 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 [this message]
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
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=5405A31E.1060403@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=david@protonic.nl \
    --cc=linux-can@vger.kernel.org \
    --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.