Linux CAN drivers development
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Matt Sealey <neko@bakuhatsu.net>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: imprecise external abort using the flexcan driver on i.MX6Q
Date: Fri, 27 Sep 2013 11:41:27 +0200	[thread overview]
Message-ID: <21061.21191.197931.54061@ipc1.ka-ro> (raw)
In-Reply-To: <CAHCPf3u7qpdiqoOhD1yxoHybgS1+mvdd8xxaTKnK-DJ9sJYY7g@mail.gmail.com>

Hi,

Matt Sealey writes:
> Hi Russel,
> 
> On Thu, Sep 26, 2013 at 10:54 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> >
> > The code here is:
> >
> >    0:   f57ff04e        dsb     st
> >    4:   e3a01000        mov     r1, #0
> >    8:   e5820000        str     r0, [r2]
> >    c:   f57ff04e        dsb     st
> >   10:   e5820004        str     r0, [r2, #4]
> >
> > Given the dsbs there, it's probably the str r0, [r2] which provoked it,
> > and we can see from the register dump, r2 is not NULL.
> 
> For reference, that was:
> 
> |r7 : 04000000  r6 : c0a18088  r5 : be168000  r4 : c0a18000
> |r3 : 00000001  r2 : c0a18090  r1 : 00000000  r0 : 00000000
> 
> If r2 is indeed the address of the access, then this is entirely down
> to a misuse of the hardware; from the manual:
> 
> ~
> When the FEN bit is set in the MCR, the memory area from 0x80 to 0xFF (which is
> normally occupied by MB0 to MB7) is used by the reception FIFO engine.
> Table 34-6
> shows the Rx FIFO data structure. The region 0x80-0x8F contains an
> message buffer
>
What manual are you referring to? In my "i.MX 6Dual/6Quad Applications
Processor Reference Manual, Rev. 1, 04/2013" flexcan is chapter 26 and
Table 34-6 is: Single-Ended Source Termination Resistance Settings
of the HDMI interface.

> structure which is the port through which the ARM core reads data from
> the FIFO (the
> oldest frame received and not read yet). The region 0x90-0xDF is
> reserved for internal
> use of the FIFO engine.
> ^^^^^^^^^^^^^^^^^^^^
> ~
> 
> In this case, yes, we're trying to write to 0x90. And in
> flexcan_chip_start, above the location where it dumps the array to
> hardware, FEN is set; this is reflected by the debug (mcr=0x79a2020f).
> 
> I'm surprised this ever worked.. if the area 0x90-0xDF is being used
> by the FIFO internally then the difference between i.MX53 ('working')
> and i.MX6Q ('imprecise abort') is that the i.MX6Q is causing the
> proper bus response. We can only hope that the i.MX53 is ONLY not
> causing the proper bus response and not actually letting you write
> into a FIFO internal data area..
> 
This seems a plausible explanation.

The definition:
|struct flexcan_mb {
|	u32 can_ctrl;
|	u32 can_id;
|	u32 data[2];
|};
|
|/* Structure of the hardware registers */
|struct flexcan_regs {
|	u32 mcr;		/* 0x00 */
[...]
|	struct flexcan_mb cantxfg[64];
|	                          ^^
has obviously nothing to do with reality!


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

  reply	other threads:[~2013-09-27  9:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <21060.15934.600859.167074@ipc1.ka-ro>
2013-09-26 15:42 ` imprecise external abort using the flexcan driver on i.MX6Q Marc Kleine-Budde
2013-09-26 15:54   ` Russell King - ARM Linux
2013-09-26 16:24     ` Santosh Shilimkar
2013-09-27  9:23       ` Lothar Waßmann
2013-09-27  9:43         ` Marc Kleine-Budde
2013-09-27 10:04           ` Lothar Waßmann
2013-09-27 10:14             ` Marc Kleine-Budde
2013-09-27 10:43               ` Lothar Waßmann
2013-09-26 19:04     ` Matt Sealey
2013-09-27  9:41       ` Lothar Waßmann [this message]
2013-09-27 17:24         ` Matt Sealey
2013-09-27 19:55           ` Marc Kleine-Budde
2013-09-30 11:06             ` Lothar Waßmann
2013-09-30 11:19               ` Marc Kleine-Budde
2013-09-30 11:37                 ` Lothar Waßmann
2013-09-30 11:39                   ` Marc Kleine-Budde
2013-09-27  8:59   ` Lothar Waßmann

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=21061.21191.197931.54061@ipc1.ka-ro \
    --to=lw@karo-electronics.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mkl@pengutronix.de \
    --cc=neko@bakuhatsu.net \
    /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