From: Martin Kozusky <mkozusky@kkmicro.cz>
To: linux-can@vger.kernel.org
Subject: CAN messages being lost on i.MX25 with flexcan - continued (was CAN messages being lost on i.MX25 with flexcan - 2012-04-19)
Date: Thu, 24 Oct 2013 15:48:08 +0200 [thread overview]
Message-ID: <l4b8eg$40b$1@ger.gmane.org> (raw)
Hello,
after more than year I'm back with CAN fifo overrun problems on i.MX25 board.
(it was good enough earlier, if some frames were lost, but not this time)
I have 2 flexcan interfaces, each receiving around 1100 msgs/s (situation is a little better if I use just one iface, but I need both)
I just configure them and then run:
I=0; while [ $I -le 20 ]; do dd if=/dev/zero of=/mnt/mmcblk0p1/test bs=512 count=200; sync; sleep 1; I=$(($I+1)); done
(simulate writing to SDcard with 100KB blocks in 1 sec intervals)
and start sending data from another device.
I am not running any other program (like candump etc) to read from CAN.
this is what is shown after I finish sending 35777 packets (both interfaces now connected to same bus so they should receive same data) with ip -d -s link show can0/1
2: can0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
link/can
can <LISTEN-ONLY> state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
bitrate 250000 sample-point 0.857
tq 285 prop-seg 5 phase-seg1 6 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 66500000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0
RX: bytes packets errors dropped overrun mcast
151769 19000 1699 0 1699 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
root@vmx25 /opt/waytracer$ /root/utils/ip -d -s link show can1
3: can1: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
link/can
can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
bitrate 250000 sample-point 0.857
tq 285 prop-seg 5 phase-seg1 6 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 66500000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
157377 19696 2664 0 2664 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
With just one iface used:
2: can0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
link/can
can <LISTEN-ONLY> state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
bitrate 250000 sample-point 0.857
tq 285 prop-seg 5 phase-seg1 6 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 66500000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0
RX: bytes packets errors dropped overrun mcast
233277 29201 1483 0 1483 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Too many packets are lost.
I tried to play with FLEXCAN_NAPI_WEIGHT (quota for napi) and that didn't hepl too much, if I put it too high then the system response was slow and packets still lost, also tried to change priority of CAN interrupts with (don't know if correctly)
// imx_irq_set_priority(43,14);
// imx_irq_set_priority(44,14);
But it didn't help either.
Does anybody have any idea how not to lose any packets? :)
Thanks,
Martin
next reply other threads:[~2013-10-24 13:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 13:48 Martin Kozusky [this message]
2013-10-25 12:59 ` CAN messages being lost on i.MX25 with flexcan - continued (was CAN messages being lost on i.MX25 with flexcan - 2012-04-19) Martin Kozusky
2013-10-25 17:58 ` Wolfgang Grandegger
2013-10-26 18:18 ` Martin Kozusky
2013-10-26 19:40 ` Wolfgang Grandegger
2013-10-29 10:46 ` Martin Kozusky
2013-10-29 12:03 ` Wolfgang Grandegger
2013-10-29 12:22 ` Wolfgang Grandegger
2013-10-29 12:49 ` Martin Kozusky
2013-10-29 12:54 ` Gary Thomas
2013-10-29 13:00 ` "Martin Kožuský [KK micro s.r.o.]"
2013-10-29 12:40 ` Martin Kozusky
2013-10-29 14:30 ` Wolfgang Grandegger
2013-10-30 8:43 ` "Martin Kožuský [KK micro s.r.o.]"
2013-10-30 9:04 ` Wolfgang Grandegger
2013-10-30 9:14 ` "Martin Kožuský [KK micro s.r.o.]"
2013-10-30 9:27 ` Wolfgang Grandegger
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='l4b8eg$40b$1@ger.gmane.org' \
--to=mkozusky@kkmicro.cz \
--cc=linux-can@vger.kernel.org \
/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).