All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Schurig <holgerschurig@gmail.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Tom Evans <tom_usenet@optusnet.com.au>, linux-can@vger.kernel.org
Subject: Re: CAN question: how to trace frame errors?
Date: Wed, 24 Jun 2015 16:29:12 +0200	[thread overview]
Message-ID: <CAOpc7mHta0KMM-psYtXD-1OrBXpQwo39KSkPL7nf2Bcgp6V5+Q@mail.gmail.com> (raw)
In-Reply-To: <55880A8A.7010903@pengutronix.de>

Okay, I'm now switched to Linux to 4.0.6, applied CONFIG_PREEMPT_RT
4.0.5-rt4 on top of it and enabled PREEMPT_RT_FULL. I had to disable
CPU_FREQ, otherwise I had weird errors (despite using the performance
governor). The system booted, but systemd said that a call to loadkeys
failed. I got the idea to remove CPU_FREQ from the Xinomai project :-)

Unfortuantely, removing CPU_FREQ also took IMX_THERMAL with it. So I
can't see the die temperature anymore in /sys/.

This time the system seems to behave more stable. I had however once a
hard lock when I started X11. Keyboard didn't work anymore, mouse
neither. Unfortunately I had not redirected output to the serial port.
And it only happened once so far. Still not convincing.

With that, I still had CAN frame losses until I applied the
flexcan-kfifo patch that I posted. I think that with a pristine
flexcan.c, the the latency [IRQ, flexcan_irq(), flexcan_poll()] is
still to long.



I'm not really fond of adding a 771 kB long patch (CONFIG_PREEMPT_RT)
to my system that worked stable since at least half a year. So I
pondered about using the FIQ. There's no other driver using a FIQ on
my system (e.g. I don't use sound/soc/imx-fiq-pcm.c for sound over
SSI). I think writing a ringbuffer in ARM assembly is doable. The FIQ
ISR would then read the FlexCAN registers and write them into the
ringbuffer. And in case of data in the RxFIFO, it would empty it and
write it to the ringbuffer as well. Emptying this ringbuffer could
then again happen in flexcan_poll(). One building block that I'm still
missing for this would be how the FIQ-ISR could signal from
FIQ-context back to the normal Linux context that there is now data in
the ringbuffer.

This sound like lots of hoops, but such a change would make FlexCAN be
able to receive CAN packets even with 100% busload and very small
package sizes. And I wouldn't have to deal with the complexity of the
realtime kernel. They are frankly over my head ...

  reply	other threads:[~2015-06-24 14:29 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
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 [this message]
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=CAOpc7mHta0KMM-psYtXD-1OrBXpQwo39KSkPL7nf2Bcgp6V5+Q@mail.gmail.com \
    --to=holgerschurig@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=tom_usenet@optusnet.com.au \
    /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.