Errors on ID and/or data collision
System setup
Altera SoC Cyclone V, two CTU_CAN_FD controllers connected over a cable.
Interafaces setup
# ip link set can0 up type can \
bitrate 1000000 \
dbitrate 1000000 \
fd on
[ 57.499341] ctucanfd c0041000.ctu_can_fd can0: ctu_can_fd device registered
[ 57.506293] ctucanfd c0041000.ctu_can_fd can0: ctucan_err_interrupt: ISR = 0x00000010, rxerr 0, txerr 0, error type 0, pos 31, ALC id_field 0, bit 0
[ 57.506304] ctucanfd c0041000.ctu_can_fd can0: Fault conf: state = 0
[ 57.506310] ctucanfd c0041000.ctu_can_fd can0: reached error active state
[ 57.533324] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
# ip link set can1 up type can \
bitrate 1000000 \
dbitrate 1000000 \
fd on
Induce of the error state
- Start generating some messages:
# while cansend can0 011#bb.cc.ee;do true; done
- And then on the other interface start generating messages with the same ID
# while cansend can1 011#11.22.33;do true; done
The behavior slightly differs depending on whether the data field of both messages differs or is the same:
-
When data field of both messages differs both
cansend
will fail with errorwrite: No buffer space available
(which is expected). -
When data fields are the same (so the entire message is the same) one
cansend
fails withwrite: No buffer space available
but the other keeps running with no data being sent on the bus
Kernel log:
[ 253.197806] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 96, txerr 0, error type 0, pos 3, ALC id_field 0, bit 0
[ 253.211074] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.216942] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000c14, rxerr 124, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.230295] ctucanfd c0052000.ctu_can_fd can1: Fault conf: state = 1
[ 253.236814] ctucanfd c0052000.ctu_can_fd can1: error_warning, but ISR[FCSI] was set! (HW bug?)
[ 253.245757] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.251605] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000804, rxerr 120, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.264953] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.270812] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000804, rxerr 116, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.284161] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.290007] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000804, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.303339] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.309155] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.322482] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.328294] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.341619] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.347431] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.360756] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.366567] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.379892] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.385704] ctucanfd c0052000.ctu_can_fd can1: ctucan_err_interrupt: ISR = 0x00000004, rxerr 112, txerr 0, error type 2, pos 7, ALC id_field 0, bit 0
[ 253.399028] ctucanfd c0052000.ctu_can_fd can1: error_warning
[ 253.424568] ctucanfd c0052000.ctu_can_fd can1: ctucan_interrupt: stuck interrupt (isr=0x00000004), stopping
[ 253.434351] ------------[ cut here ]------------
[ 253.438968] WARNING: CPU: 0 PID: 24969 at net/core/skbuff.c:617 skb_release_head_state+0x9c/0xa4
[ 253.447712] Modules linked in: ctucanfd(O)
[ 253.451802] CPU: 0 PID: 24969 Comm: bash Tainted: G O 5.1.0+ #1
[ 253.458991] Hardware name: Altera SOCFPGA
[ 253.462980] Backtrace:
[ 253.465427] [<c010e554>] (dump_backtrace) from [<c010e7dc>] (show_stack+0x20/0x24)
[ 253.472964] r7:00000269 r6:60010193 r5:00000000 r4:c0c7a978
[ 253.478606] [<c010e7bc>] (show_stack) from [<c080f4d0>] (dump_stack+0x90/0xa4)
[ 253.485803] [<c080f440>] (dump_stack) from [<c0123134>] (__warn.part.3+0xcc/0xe8)
[ 253.493253] r7:00000269 r6:00000009 r5:00000000 r4:00000000
[ 253.498892] [<c0123068>] (__warn.part.3) from [<c01232d0>] (warn_slowpath_null+0x54/0x5c)
[ 253.507032] r7:c0b8bc80 r6:c069ff64 r5:00000269 r4:c0a4602c
[ 253.512671] [<c012327c>] (warn_slowpath_null) from [<c069ff64>] (skb_release_head_state+0x9c/0xa4)
[ 253.521590] r6:edc3d540 r5:c06b0e40 r4:edc3d540
[ 253.526190] [<c069fec8>] (skb_release_head_state) from [<c069ff88>] (skb_release_all+0x1c/0x34)
[ 253.534847] r5:c06b0e40 r4:edc3d540
[ 253.538409] [<c069ff6c>] (skb_release_all) from [<c06a0014>] (kfree_skb+0x4c/0xd8)
[ 253.545942] r5:c06b0e40 r4:edc3d540
[ 253.549508] [<c069ffc8>] (kfree_skb) from [<c06b0e40>] (enqueue_to_backlog+0xc0/0x22c)
[ 253.557388] r7:c0b8bc80 r6:edc3d540 r5:c0b8bc80 r4:ef7cfc80
[ 253.563027] [<c06b0d80>] (enqueue_to_backlog) from [<c06b84bc>] (netif_rx_internal+0x90/0x1b0)
[ 253.571602] r10:ededf000 r9:00000002 r8:00000000 r7:00000001 r6:edc3d540 r5:c0ca5a28
[ 253.579395] r4:c0c08c48 r3:edff6000
[ 253.582959] [<c06b842c>] (netif_rx_internal) from [<c06b8640>] (netif_rx+0x34/0x124)
[ 253.590668] r7:00000001 r6:ededf604 r5:ededf5e8 r4:edc3d540
[ 253.596311] [<c06b860c>] (netif_rx) from [<c05b8abc>] (can_get_echo_skb+0x40/0x60)
[ 253.603844] r5:ededf5e8 r4:c0c08c48
[ 253.607416] [<c05b8a7c>] (can_get_echo_skb) from [<bf000844>] (ctucan_interrupt+0x314/0x75c [ctucanfd])
[ 253.616764] r4:00000002
[ 253.619295] [<bf000530>] (ctucan_interrupt [ctucanfd]) from [<c0172b8c>] (__handle_irq_event_percpu+0xa8/0x278)
[ 253.629339] r10:c0c805e0 r9:edff7a68 r8:ef080800 r7:0000002b r6:00000000 r5:ef1b4d68
[ 253.637131] r4:ee8ac740
[ 253.639657] [<c0172ae4>] (__handle_irq_event_percpu) from [<c0172d98>] (handle_irq_event_percpu+0x3c/0x90)
[ 253.649267] r10:ffffe000 r9:f0803100 r8:ef080800 r7:00000001 r6:ef1b4d00 r5:ef1b4d68
[ 253.657059] r4:c0c08c48
[ 253.659584] [<c0172d5c>] (handle_irq_event_percpu) from [<c0172e40>] (handle_irq_event+0x54/0x78)
[ 253.668415] r6:edff7c40 r5:ef1b4d68 r4:ef1b4d00
[ 253.673017] [<c0172dec>] (handle_irq_event) from [<c0177678>] (handle_fasteoi_irq+0xc4/0x17c)
[ 253.681503] r7:00000001 r6:edff7c40 r5:c0c093d0 r4:ef1b4d00
[ 253.687145] [<c01775b4>] (handle_fasteoi_irq) from [<c0171ba4>] (generic_handle_irq+0x34/0x44)
[ 253.695715] r5:00000000 r4:c0b8af38
[ 253.699278] [<c0171b70>] (generic_handle_irq) from [<c0172298>] (__handle_domain_irq+0x6c/0xc4)
[ 253.707940] [<c017222c>] (__handle_domain_irq) from [<c01022e8>] (gic_handle_irq+0x5c/0xa0)
[ 253.716256] r9:f0803100 r8:edff7b28 r7:f0802100 r6:f080210c r5:c0c528e8 r4:c0c093d0
[ 253.723966] [<c010228c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0x90)
[ 253.731414] Exception stack(0xedff7b28 to 0xedff7b70)
[ 253.736437] 7b20: c0b8af80 00000000 2ec44000 c0b8af80 00404040 00000000
[ 253.744580] 7b40: 00000000 00000001 ef080800 0000000c ffffe000 edff7bdc 2ec44000 edff7b78
[ 253.752719] 7b60: 00404040 c01023ec 60010113 ffffffff
[ 253.757751] r9:edff6000 r8:ef080800 r7:edff7b5c r6:ffffffff r5:60010113 r4:c01023ec
[ 253.765463] [<c0102330>] (__do_softirq) from [<c0129898>] (irq_exit+0x88/0x94)
[ 253.772655] r10:b6e6d000 r9:f0803100 r8:ef080800 r7:00000001 r6:00000000 r5:00000000
[ 253.780447] r4:c0b8af38
[ 253.782972] [<c0129810>] (irq_exit) from [<c017229c>] (__handle_domain_irq+0x70/0xc4)
[ 253.790767] [<c017222c>] (__handle_domain_irq) from [<c01022e8>] (gic_handle_irq+0x5c/0xa0)
[ 253.799081] r9:f0803100 r8:edff7c40 r7:f0802100 r6:f080210c r5:c0c528e8 r4:c0c093d0
[ 253.806790] [<c010228c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0x90)
[ 253.814236] Exception stack(0xedff7c40 to 0xedff7c88)
[ 253.819268] 7c40: ee6810c0 b6e6d000 3f70959f 00000001 3f70959f ffefe1b8 b6e6d000 effe7100
[ 253.827410] 7c60: ffefe1b4 edff7da4 b6e6d000 edff7ca4 edff7ca8 edff7c90 c024be7c c024b544
[ 253.835548] 7c80: 20010013 ffffffff
[ 253.839024] r9:edff6000 r8:ffefe1b4 r7:edff7c74 r6:ffffffff r5:20010013 r4:c024b544
[ 253.846737] [<c024b538>] (_vm_normal_page) from [<c024be7c>] (unmap_page_range+0x224/0x718)
[ 253.855048] r5:ffefe1b8 r4:3f70959f
[ 253.858610] [<c024bc58>] (unmap_page_range) from [<c024c3fc>] (unmap_single_vma+0x8c/0x94)
[ 253.866838] r10:edff7e60 r9:00000001 r8:00000000 r7:edff7da4 r6:b6d96000 r5:ee6810c0
[ 253.874631] r4:b6eca000
[ 253.877155] [<c024c370>] (unmap_single_vma) from [<c024c56c>] (unmap_vmas+0x64/0x78)
[ 253.884863] r7:00000000 r6:edff7da4 r5:ffffffff r4:ee6810c0
[ 253.890500] [<c024c508>] (unmap_vmas) from [<c0252e48>] (exit_mmap+0xe0/0x17c)
[ 253.897691] r8:ef3cec00 r7:ef3cec00 r6:c0c08c48 r5:00000000 r4:ee6816c0
[ 253.904365] [<c0252d68>] (exit_mmap) from [<c011fee0>] (mmput+0x58/0x100)
[ 253.911124] r7:ee6cbc00 r6:ef3cf800 r5:00000000 r4:ef3cec00
[ 253.916764] [<c011fe88>] (mmput) from [<c027d734>] (flush_old_exec+0x4ec/0x704)
[ 253.924039] r5:ef3cec00 r4:eea5ce00
[ 253.927606] [<c027d248>] (flush_old_exec) from [<c02d9124>] (load_elf_binary+0x21c/0x14f4)
[ 253.935835] r10:edff7e60 r9:00000001 r8:ee6cb400 r7:edea45b4 r6:ee6cbc00 r5:c0c08c48
[ 253.943627] r4:edea4580
[ 253.946154] [<c02d8f08>] (load_elf_binary) from [<c027d9f8>] (search_binary_handler.part.2+0xac/0x24c)
[ 253.955420] r10:ee6cbc00 r9:c09f43e8 r8:c0c9ce60 r7:c0c25644 r6:fffffff8 r5:c0c9ce60
[ 253.963211] r4:c0c28500
[ 253.965738] [<c027d94c>] (search_binary_handler.part.2) from [<c027e1e4>] (__do_execve_file+0x57c/0x83c)
[ 253.975176] r10:ee6cbc00 r9:00006189 r8:00006189 r7:ffffe000 r6:eea5ce00 r5:ee4f9000
[ 253.982968] r4:c0c08c48
[ 253.985494] [<c027dc68>] (__do_execve_file) from [<c027e9b8>] (sys_execve+0x44/0x4c)
[ 253.993204] r10:0000000b r9:edff6000 r8:c0101204 r7:0000000b r6:00514728 r5:005163c8
[ 254.000997] r4:00503808
[ 254.003523] [<c027e974>] (sys_execve) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[ 254.011142] Exception stack(0xedff7fa8 to 0xedff7ff0)
[ 254.016171] 7fa0: 004f34bc 004f34bc 00514728 00503808 005163c8 f0de3100
[ 254.024314] 7fc0: 004f34bc 004f34bc 00514728 0000000b 004f84dc 00503808 005163c8 b6f848c8
[ 254.032452] 7fe0: 004f3790 be8f3734 004513f0 b6e3795c
[ 254.037481] r5:004f34bc r4:004f34bc
[ 254.041039] ---[ end trace d3e1f1104b9555ca ]---
[ 254.045663] ctucanfd c0041000.ctu_can_fd can0: Fault conf: state = 2
[ 254.052163] ctucanfd c0041000.ctu_can_fd can0: error_passive
[ 254.078239] ctucanfd c0041000.ctu_can_fd can0: ctucan_interrupt: stuck interrupt (isr=0x00000004), stopping
[ 254.088247] ctucanfd c0041000.ctu_can_fd can0: rx fifo overflow