From: Tom Evans <tom_usenet@optusnet.com.au>
To: Holger Schurig <holgerschurig@gmail.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: CAN question: how to trace frame errors?
Date: Sun, 14 Jun 2015 01:30:11 +1000 [thread overview]
Message-ID: <557C4C83.3020501@optusnet.com.au> (raw)
In-Reply-To: <CAOpc7mG5nD1daKSkGdqoR84=W_A11s+oQfzc_i4pUsHoVd42Tw@mail.gmail.com>
On 13/06/2015 12:24 AM, Holger Schurig wrote:
> Thanks for the thorought answer.
>
>> so I rewrote the 3.4 FlexCAN driver to unload the FIFO into a ring buffer
>> during interrupts and to have the NAPI routine unload tha
>
> Can you publish it?
This is Open Source, so yes.
> I might mangle it into a form so that I can sent
> it as a patch to Linux HEAD (and use it by myself, LOL)
I have sent the patch to flexcan.c in kernel 3.4 to Holger. It is a
fairly obvious modification with the buffer-reading code moved to the
interrupt routine, loading up a ring buffer.
>> Since the CPU is running at 800MHz, that's only 560,000 instructions
>
> I'm running with 1 GHz, but that's still not stellar. I think I'll
> look into the things you mentioned (e.g. I'm using the framebuffer
> from staging, CONFIG_FRM_IMX, but I don't have the debug things
> enabled you mentioned).
The CPU is seriously busy. It is very busy doing things in the order it
(and all the programmers who wrote it) think is appropriate, but it
isn't doing what we need to get the job done.
Changing the driver is a "bandage" fixing the first annoying symptom of
the underlying problem. I found the problem in our case (the
CONFIG_DEBUG stuff mainly), but put in the driver changes as well as I
wanted it to stay fixed in the face of kernel changes.
Another thing I changed. CPUs have had multiple interrupt priorities
(with interrupts being able to interrupt other ones) all the way back to
the PDP11, then carried through the 68000 and ColdFire chips. But not in
Linux on ARM on these chips (at least TZIC in i.MX53 in 3.4). There's
only a single level of interrupt, and while the CPU supports different
interrupt priorities, the 3.4 TZIC code simply doesn't provide the
functions to change it. As a result the interrupt priority is that
implemented by tzic_handle_irq(), which is to take the first-one-set in
HIPND registers 0 to 3, in that order. In the i.MX53 that puts the FEC
interrupt ahead of the CAN ones. I think it puts about 74 interrupts
ahead of the CAN ones. So I added code to allow the interrupt priorities
to be changed so as to reverse that.
Tom
next prev parent reply other threads:[~2015-06-13 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 9:29 CAN question: how to trace frame errors? Holger Schurig
2015-06-12 9:34 ` Marc Kleine-Budde
2015-06-12 10:01 ` Holger Schurig
2015-06-12 12:33 ` Tom Evans
2015-06-12 14:24 ` Holger Schurig
2015-06-13 15:30 ` Tom Evans [this message]
2015-06-13 20:28 ` Holger Schurig
2015-06-14 2:42 ` Tom Evans
2015-06-22 12:17 ` Holger Schurig
2015-06-22 13:15 ` Marc Kleine-Budde
2015-06-24 14:29 ` Holger Schurig
2015-06-25 8:37 ` Tom Evans
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=557C4C83.3020501@optusnet.com.au \
--to=tom_usenet@optusnet.com.au \
--cc=holgerschurig@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/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.