Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving concurrently with two mcp2515 is unstable again #5229

Closed
dionysus1016 opened this issue Oct 30, 2022 · 1 comment
Closed

Receiving concurrently with two mcp2515 is unstable again #5229

dionysus1016 opened this issue Oct 30, 2022 · 1 comment

Comments

@dionysus1016
Copy link

dionysus1016 commented Oct 30, 2022

Describe the bug

I check thread #1490 , it seems the issue is resolved after Linux kernel version 5.4, but I hit the same issue in 5.10.17-v7l+. I have two CAN mcp2515 which are can0 and can1, I can see interrupt number for can0 increasing, but interrupt number for can1 is not updated, to mitigate the issue, I have to ifconfig down then up the can1 interface

CAN interfaces:

pi@raspberrypi:~ $ ls -l /sys/class/net/can*
lrwxrwxrwx 1 root root 0 Oct 13 18:17 /sys/class/net/can0 -> ../../devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.0/net/can0
lrwxrwxrwx 1 root root 0 Oct 13 18:17 /sys/class/net/can1 -> ../../devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/net/can1

CAN interface settings:

dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=25
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23

interrupts for CAN interface:

65: 386461527 0 0 0 pinctrl-bcm2835 23 Level spi0.0
66: 196348589 0 0 0 pinctrl-bcm2835 25 Level spi0.1

65: 386468363 0 0 0 pinctrl-bcm2835 23 Level spi0.0
66: 196348589 0 0 0 pinctrl-bcm2835 25 Level spi0.1 <------ the number number never changes

dmesg:

[ 862.822709] NET: Registered protocol family 29
[ 862.835495] can: raw protocol
[ 863.733343] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[61747.752702] mcp251x spi0.1 can1: bus-off
[62052.360283] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[64433.021816] mcp251x spi0.1 can1: bus-off
[64909.268667] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[73818.267806] mcp251x spi0.1 can1: bus-off
[74703.469522] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[166261.970958] mcp251x spi0.1 can1: bus-off
[236447.829068] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[271674.431391] mcp251x spi0.1 can1: bus-off
[391296.075989] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[417058.187329] mcp251x spi0.1 can1: bus-off
[417916.801653] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[603595.631653] mcp251x spi0.1 can1: bus-off
[668950.224509] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[777225.942027] mcp251x spi0.1 can1: bus-off
[777773.129797] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[778675.537745] mcp251x spi0.1 can1: bus-off
[780130.573070] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[781559.329248] mcp251x spi0.1 can1: bus-off
[787619.193734] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[868826.758855] mcp251x spi0.1 can1: bus-off
[873260.941913] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[934716.070344] mcp251x spi0.1 can1: bus-off
[937716.577485] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[947891.235598] mcp251x spi0.1 can1: bus-off
[950271.578745] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[950653.701456] mcp251x spi0.1 can1: bus-off
[953176.018484] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[1003151.014732] mcp251x spi0.1 can1: bus-off
[1005757.532597] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[1006760.804413] mcp251x spi0.1 can1: bus-off

pi@raspberrypi:~ $ ip -details -statistics link show can1
5: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/can promiscuity 0 minmtu 0 maxmtu 0
can state BUS-OFF restart-ms 0
bitrate 500000 sample-point 0.875
tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 146 147 16 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
1927848968 240981121 60366 7 60366 0
TX: bytes packets errors dropped carrier collsns
12173752 1521719 16 16 0 0

Steps to reproduce the behaviour

a long time stress might reproduce the issue, but not always happens

Device (s)

Raspberry Pi 4 Mod. B

System

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

Logs

No response

Additional context

No response

@dionysus1016
Copy link
Author

dionysus1016 commented Oct 31, 2022

We try to figure out more details to check whether this is our code issue or system issue, close this issue for now to avoid noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant