Re: Testing two MCP2518FD's on i.MX8MM
From: Fabio Estevam <festevam@gmail.com>
Date: 2021-06-21 12:24:46
Hi Marc, On Tue, Jun 15, 2021 at 4:15 AM Marc Kleine-Budde [off-list ref] wrote:
The imx SPI driver has quite some overhead, when it comes to small SPI transfers. The mcp251fd driver performs much better with the SPI IP cores on the raspi, which have quite good optimized drivers. Hook up a scope to the SPI's clock and chip select lines of the imx, you'll see the time between end of transfer until the chip select is inactive is longer than the SPI transfer itself. I expect most bang for the buck can be archived by adding an IRQ less busy polling transfer mode, which kicks in below a certain SPI transfer length. On the mcp251xfd driver side, there is some room for optimization. The basic idea is to reduce the number of SPI transfers by combining several reads into one transfer. This can be done in some places. For peak loads in CAN-2.0 mode it would be interesting to make use of the remaining RAM for a 2nd FIFO.
Thanks for your reply. I do see some RCU related errors every time the application is launched: # ./cantest.sh start root@verdin-imx8mm:~# interface = can1, family = 29, ty[ 17.484220] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! [ 17.484240] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! pe = 3, proto = 1 interface = ca[ 17.502870] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! n0, family = 29, type = 3, proto [ 17.502912] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! = 1 interface = can1, family = 2[ 17.524457] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! 9, type = 3, proto = 1 interface[ 17.524476] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! = can0, family = 29, type = 3, p[ 17.535223] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! roto = 1 [ 17.557284] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! [ 17.557284] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! [ 17.574035] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! [ 17.574037] NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! [ 18.435652] sched: RT throttling activated After some time: [ 292.197058] rcu: 0-....: (1 GPs behind) idle=6db/1/0x4000000000000002 softirq=2974/2975 fqs=7882 [ 292.206039] (t=21003 jiffies g=1249 q=1317) [ 292.210316] Task dump for CPU 0: [ 292.213549] task:cansequence state:R running task stack: 0 pid: 374 ppid: 1 flags:0x00000202 [ 292.223485] Call trace: [ 292.225932] dump_backtrace+0x0/0x1a8 [ 292.229613] show_stack+0x18/0x28 [ 292.232936] sched_show_task+0x150/0x170 [ 292.236869] dump_cpu_task+0x44/0x54 [ 292.240453] rcu_dump_cpu_stacks+0xf4/0x13c [ 292.244648] rcu_sched_clock_irq+0x844/0xdc0 [ 292.248929] update_process_times+0x98/0xe8 [ 292.253125] tick_nohz_handler+0xac/0x110 [ 292.257142] arch_timer_handler_phys+0x34/0x48 [ 292.261598] handle_percpu_devid_irq+0x84/0x148 [ 292.266138] handle_domain_irq+0x60/0x90 [ 292.270071] gic_handle_irq+0x54/0x120 [ 292.273833] call_on_irq_stack+0x28/0x50 [ 292.277767] do_interrupt_handler+0x54/0x60 [ 292.281964] el1_interrupt+0x30/0x78 [ 292.285550] el1h_64_irq_handler+0x18/0x28 [ 292.289653] el1h_64_irq+0x78/0x7c [ 292.293061] __audit_syscall_exit+0x8/0x238 [ 292.297256] el0_svc_common+0x60/0xd8 [ 292.300927] do_el0_svc+0x28/0x90 [ 292.304249] el0_svc+0x24/0x38 [ 292.307312] el0t_64_sync_handler+0xb0/0xb8 [ 292.311502] el0t_64_sync+0x198/0x19c 2020-02-12 19:28:40:388 sequence CNT: 1586297, RX: 93 expected: 121 missing: 228 skt overfl d: 0 a: 0 delta: 228 incident: 1 seq_wrap RX: 6196 sequ_wrap_expected: 6196 overall lost: 4294967268 2020-02-12 19:28:40:389 sequence CNT: 95, RX: 121 expected: 95 missing: 26 skt overfl d: 0 a: 0 delta: 26 incident: 2 seq_wrap RX: 6196 sequ_wrap_expected: 6196 overall lost: 4294967294 2020-02-12 19:28:40:389 sequence CNT: 125, RX: 127 expected: 125 missing: 2 skt overfl d: 0 a: 0 delta: 2 incident: 3 seq_wrap RX: 6196 sequ_wrap_expected: 6196 overall lost: 0 Any ideas how these RCU errors could be fixed? Thanks, Fabio Estevam