Part Number: DRA744
Tool/software: Linux
In our system, DRA744 (J6) processor is connected to a SPC560B64 micro-controller over two SPI buses (GPIO7) and also some GPIO4 pins. Linux version 4.14.40 runs on the A15 cores of J6 processor. The IPU (m4) in J6 handles the communication between J6 and SPC560B64 over SPIs and GPIO pins. The IPU sends/receives data to A15 Linux over shared memory and hardware mailbox in J6. A loadable kernel driver in Linux handles the communication in Linux between m4 and A15. As soon as I insert the LKM into kernel, kernel generates continuously a large number of unexpected IRQ trap at vector 00. Something similar to this thread happens:
e2e.ti.com/.../627064
A part of dmesg shows the issue:
[ 53.692626] irq 0, desc: ee803700, depth: 1, count: 0, unhandled: 0
[ 53.692631] ->handle_irq(): c0175ab0,
[ 53.692648] handle_bad_irq+0x0/0x268
[ 53.692653] ->irq_data.chip(): c0931aa4,
[ 53.692659] 0xc0931aa4
[ 53.692666] ->action(): (null)
[ 53.692671] IRQ_NOPROBE set
[ 53.692675] IRQ_NOREQUEST set
[ 53.692681] unexpected IRQ trap at vector 00
[ 53.697017] cxx_can - Registered with MQ message engine
[ 53.712686] cxx_can - Received CAN bit-timing parameters (1)
[ 53.712701] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 53.715042] irq 0, desc: ee803700, depth: 1, count: 0, unhandled: 0
[ 53.715045] ->handle_irq(): c0175ab0,
[ 53.715054] handle_bad_irq+0x0/0x268
[ 53.715057] ->irq_data.chip(): c0931aa4,
[ 53.715062] 0xc0931aa4
[ 53.715066] ->action(): (null)
[ 53.715070] IRQ_NOPROBE set
[ 53.715073] IRQ_NOREQUEST set
[ 53.715077] unexpected IRQ trap at vector 00
[ 53.725145] pgd = c0004000
[ 53.727890] [00000000] *pgd=00000000
[ 53.731489] Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
[ 53.745892] irq 0, desc: ee803700, depth: 1, count: 0, unhandled: 0
[ 53.745896] ->handle_irq(): c0175ab0,
[ 53.745904] handle_bad_irq+0x0/0x268
[ 53.745907] ->irq_data.chip(): c0931aa4,
[ 53.745912] 0xc0931aa4
[ 53.745916] ->action(): (null)
[ 53.745920] IRQ_NOPROBE set
[ 53.745923] IRQ_NOREQUEST set
[ 53.745926] unexpected IRQ trap at vector 00
[ 53.780151] irq 0, desc: ee803700, depth: 1, count: 0, unhandled: 0
[ 53.780155] ->handle_irq(): c0175ab0,
[ 53.780164] handle_bad_irq+0x0/0x268
[ 53.780167] ->irq_data.chip(): c0931aa4,
[ 53.780172] 0xc0931aa4
[ 53.780176] ->action(): (null)
[ 53.780180] IRQ_NOPROBE set
[ 53.780182] IRQ_NOREQUEST set
[ 53.780186] unexpected IRQ trap at vector 00
[ 53.814638] irq 0, desc: ee803700, depth: 1, count: 0, unhandled: 0
[ 53.814641] ->handle_irq(): c0175ab0,
[ 53.814650] handle_bad_irq+0x0/0x268
[ 53.814653] ->irq_data.chip(): c0931aa4,
[ 53.814658] 0xc0931aa4
[ 53.814661] ->action(): (null)
[ 53.814664] IRQ_NOPROBE set
[ 53.814667] IRQ_NOREQUEST set
[ 53.814670] unexpected IRQ trap at vector 00
[ 53.816696] unexpected IRQ trap at vector 00
[ 53.821296] unexpected IRQ trap at vector 00
[ 53.897185] CPU: 1 PID: 317 Comm: k_cxx_can_rx Tainted: G O 4.14.40 #1
[ 53.904874] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 53.910994] task: ecca8600 task.stack: ecde8000
[ 53.915559] PC is at cxx_can_rx_thread+0x678/0xf08 [cxx_can]
[ 53.921248] LR is at irq_work_queue+0xc8/0xf0
[ 53.925623] pc : [<bf2c81b4>] lr : [<c01b7e60>] psr: 60010013
[ 53.931917] sp : ecde9f10 ip : ecde9dd0 fp : ecde9f74
[ 53.937165] r10: 3b9aca00 r9 : bf2cb660 r8 : ece2c000
[ 53.942412] r7 : bf2ca230 r6 : 00000825 r5 : bf2cc5c0 r4 : ecf80000
[ 53.948967] r3 : 00000000 r2 : 00000000 r1 : 00000001 r0 : ecdc1c00
[ 53.955523] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 53.962689] Control: 10c5387d Table: ad88806a DAC: 00000051
[ 53.968460] Process k_cxx_can_rx (pid: 317, stack limit = 0xecde8210)
[ 53.974929] Stack: (0xecde9f10 to 0xecdea000)
[ 53.979306] 9f00: ecde9f34 ecde9f20 c05f6d84 c05f64b4
[ 53.987522] 9f20: ecdc1c04 ecdc1c00 ecde9f44 ecde9f38 c05f6de0 00000000 ecca8600 c016a584
[ 53.995738] 9f40: ecde9f40 ecde9f40 bf2c7b3c 00000000 ecd36f00 ecd36e80 ecde8000 ece2c000
[ 54.001841] unexpected IRQ trap at vector 00
[ 54.008233] 9f60: bf2c7b3c ecdc1c00 ecde9fac ecde9f78 c014d684 bf2c7b48 ecd36f1c ecd36f1c
[ 54.016447] 9f80: ecde9fac ecd36e80 c014d538 00000000 00000000 00000000 00000000 00000000
[ 54.024663] 9fa0: 00000000 ecde9fb0 c0108048 c014d544 00000000 00000000 00000000 00000000
[ 54.032877] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 54.041091] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 54.049301] Backtrace:
[ 54.051778] [<bf2c7b3c>] (cxx_can_rx_thread [cxx_can]) from [<c014d684>] (kthread+0x14c/0x164)
[ 54.060429] r10:ecdc1c00 r9:bf2c7b3c r8:ece2c000 r7:ecde8000 r6:ecd36e80 r5:ecd36f00
[ 54.068291] r4:00000000
[ 54.070844] [<c014d538>] (kthread) from [<c0108048>] (ret_from_fork+0x14/0x2c)
[ 54.078099] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c014d538
[ 54.078304] unexpected IRQ trap at vector 00
[ 54.090243] r4:ecd36e80
[ 54.092790] Code: e3530000 1a00018d e3a03000 e51b0050 (e893000a)
[ 54.098957] ---[ end trace 6da5cd570c595e54 ]---
[ 54.114547] unexpected IRQ trap at vector 00
[ 54.159991] unexpected IRQ trap at vector 00
[ 54.178104] unexpected IRQ trap at vector 00
[ 54.196223] unexpected IRQ trap at vector 00
[ 54.210230] unexpected IRQ trap at vector 00
[ 54.241379] unexpected IRQ trap at vector 00
[ 54.255514] unexpected IRQ trap at vector 00
[ 54.273634] unexpected IRQ trap at vector 00
[ 54.296206] unexpected IRQ trap at vector 00
[ 54.300825] unexpected IRQ trap at vector 00
[ 54.313863] unexpected IRQ trap at vector 00
[ 54.331978] unexpected IRQ trap at vector 00
[ 54.364140] unexpected IRQ trap at vector 00
[ 54.382354] unexpected IRQ trap at vector 00
[ 54.413660] unexpected IRQ trap at vector 00
[ 54.431780] unexpected IRQ trap at vector 00
[ 54.445781] unexpected IRQ trap at vector 00
[ 54.458821] unexpected IRQ trap at vector 00
The output of "cat /proc/interrupts" command before inserting LKM:
CPU0 CPU1
17: 0 0 CBAR 32 Level gp_timer
20: 87665 76686 GIC-0 27 Level arch_timer
22: 0 0 CBAR 4 Level l3-dbg-irq
23: 0 0 WUGEN 10 Level l3-app-irq
25: 1 0 CBAR 121 Level talert
27: 51 0 CBAR 8 Level omap-dma-engine
30: 0 0 CBAR 361 Level 43300000.edma_ccint
32: 0 0 CBAR 359 Level 43300000.edma_ccerrint
35: 0 0 CBAR 24 Level 4ae10000.gpio
36: 10 0 CBAR 25 Level 48055000.gpio
37: 0 0 CBAR 26 Level 48057000.gpio
38: 0 0 CBAR 27 Level 48059000.gpio
39: 0 0 CBAR 28 Level 4805b000.gpio
40: 0 0 CBAR 29 Level 4805d000.gpio
41: 0 0 CBAR 30 Level 48051000.gpio
42: 0 0 CBAR 116 Level 48053000.gpio
43: 2329 0 CBAR 67 Level 4806a000.serial
62: 8 0 CBAR 108 Level omap_dmm_irq_handler
63: 451 0 CBAR 51 Level 48070000.i2c
64: 510 0 CBAR 52 Level 48072000.i2c
65: 8779 0 CBAR 57 Level 4807a000.i2c
66: 6144 0 CBAR 81 Level mmc0
67: 0 0 CBAR 23 Level 40d01000.mmu
68: 0 0 CBAR 145 Level 40d02000.mmu
69: 0 0 CBAR 395 Level 58882000.mmu
70: 0 0 CBAR 396 Level 55082000.mmu
73: 0 0 CBAR 217 Level rtc0
77: 0 0 CBAR 149 Level 48464000.mcasp_tx
78: 0 0 CBAR 148 Level 48464000.mcasp_rx
79: 0 0 CBAR 161 Level 4847c000.mcasp_tx
80: 0 0 CBAR 160 Level 4847c000.mcasp_rx
82: 126 0 CBAR 335 Level 48484000.ethernet
83: 0 0 CBAR 336 Level 48484000.ethernet
85: 754259 0 CBAR 16 Level SGX ISR
90: 0 0 CBAR 46 Level 4b101000.sham
91: 0 0 CBAR 47 Level 48090000.rng
92: 0 0 CBAR 354 Level vpe
93: 0 0 CBAR 146 Level 41501000.mmu
94: 0 0 CBAR 147 Level 41502000.mmu
95: 0 0 CBAR 352 Level vip2-s0
97: 0 0 WUGEN 131 Level arm-pmu
98: 0 0 WUGEN 132 Level arm-pmu
99: 188827 0 CBAR 20 Level OMAP DISPC
194: 10 0 48055000.gpio 26 Edge 3-0024
IPI0: 0 1 CPU wakeup interrupts
IPI1: 0 0 Timer broadcast interrupts
IPI2: 374440 783251 Rescheduling interrupts
IPI3: 1085 1134 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 0 0 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 0
And after:
CPU0 CPU1
0: 108 0 none Edge
17: 0 0 CBAR 32 Level gp_timer
20: 2710 3197 GIC-0 27 Level arch_timer
22: 0 0 CBAR 4 Level l3-dbg-irq
23: 0 0 WUGEN 10 Level l3-app-irq
25: 2 0 CBAR 121 Level talert
27: 51 0 CBAR 8 Level omap-dma-engine
30: 0 0 CBAR 361 Level 43300000.edma_ccint
32: 0 0 CBAR 359 Level 43300000.edma_ccerrint
35: 0 0 CBAR 24 Level 4ae10000.gpio
36: 10 0 CBAR 25 Level 48055000.gpio
37: 0 0 CBAR 26 Level 48057000.gpio
38: 0 0 CBAR 27 Level 48059000.gpio
39: 0 0 CBAR 28 Level 4805b000.gpio
40: 0 0 CBAR 29 Level 4805d000.gpio
41: 335 0 CBAR 30 Level 48051000.gpio
42: 0 0 CBAR 116 Level 48053000.gpio
43: 442 0 CBAR 67 Level 4806a000.serial
44: 748 0 CBAR 21 Edge can handler
62: 8 0 CBAR 108 Level omap_dmm_irq_handler
63: 451 0 CBAR 51 Level 48070000.i2c
64: 510 0 CBAR 52 Level 48072000.i2c
65: 394 0 CBAR 57 Level 4807a000.i2c
66: 3369 0 CBAR 81 Level mmc0
67: 0 0 CBAR 23 Level 40d01000.mmu
68: 0 0 CBAR 145 Level 40d02000.mmu
69: 0 0 CBAR 395 Level 58882000.mmu
70: 0 0 CBAR 396 Level 55082000.mmu
73: 0 0 CBAR 217 Level rtc0
77: 0 0 CBAR 149 Level 48464000.mcasp_tx
78: 0 0 CBAR 148 Level 48464000.mcasp_rx
79: 0 0 CBAR 161 Level 4847c000.mcasp_tx
80: 0 0 CBAR 160 Level 4847c000.mcasp_rx
82: 0 0 CBAR 335 Level 48484000.ethernet
83: 0 0 CBAR 336 Level 48484000.ethernet
85: 18745 0 CBAR 16 Level SGX ISR
90: 0 0 CBAR 46 Level 4b101000.sham
91: 0 0 CBAR 47 Level 48090000.rng
92: 0 0 CBAR 354 Level vpe
93: 0 0 CBAR 146 Level 41501000.mmu
94: 0 0 CBAR 147 Level 41502000.mmu
95: 0 0 CBAR 352 Level vip2-s0
97: 0 0 WUGEN 131 Level arm-pmu
98: 0 0 WUGEN 132 Level arm-pmu
99: 4949 0 CBAR 20 Level OMAP DISPC
194: 10 0 48055000.gpio 26 Edge 3-0024
IPI0: 0 1 CPU wakeup interrupts
IPI1: 0 0 Timer broadcast interrupts
IPI2: 9348 21719 Rescheduling interrupts
IPI3: 1841 621 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 82 0 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 108
It should be mentioned that inside the IPU (m4) code the GPIO4 and GPIO7 IRQ connections to A15 cores is deactivated:
// Unmap GPIO_4 IRQ crossbar connection to A15
*(uint32_t *)CTRL_CORE_MPU_IRQ_32_33 = 0x1c0000;
// Unmap GPIO_7 IRQ crossbar connection to A15
*(uint32_t *)CTRL_CORE_MPU_IRQ_34_35 = 0x1d;
Also, in Linux device tree these sub-systems are completely disabled:
#define DISABLE_COMPLETE(label) &label { status = "disabled"; ti,no-idle; ti,no-reset-on-init; }
/* modules that are disabled from Linux */
DISABLE_COMPLETE(mmc1);
DISABLE_COMPLETE(mmc4);
DISABLE_COMPLETE(mcspi1);
DISABLE_COMPLETE(mcspi2);
DISABLE_COMPLETE(vin4a);
DISABLE_COMPLETE(i2c5);
DISABLE_COMPLETE(i2c3);
DISABLE_COMPLETE(gpmc);
DISABLE_COMPLETE(dcan1);
DISABLE_COMPLETE(dcan2);
DISABLE_COMPLETE(vin1a);
DISABLE_COMPLETE(ipu2);
DISABLE_COMPLETE(ipu1);
DISABLE_COMPLETE(dsp1);
DISABLE_COMPLETE(dsp2);
DISABLE_COMPLETE(uart2);
DISABLE_COMPLETE(uart3);
DISABLE_COMPLETE(uart4);
DISABLE_COMPLETE(uart5);
DISABLE_COMPLETE(uart6);
DISABLE_COMPLETE(wdt2);
The contents of the interrupt crossbar switch registers after inserting the LKM are as follows:
# devmem2 0x4a002a7c
/dev/mem opened.
Memory mapped at address 0xb6fa4000.
Value at address 0x4A002A7C (0xb6fa4a7c): 0x1C0000
# devmem2 0x4a002a80
/dev/mem opened.
Memory mapped at address 0xb6f5e000.
Value at address 0x4A002A80 (0xb6f5ea80): 0x1D
In order to solve the issue, I want to know why and how the interrupt #0 is created and how I might avoid it in Linux?!
CPU0 CPU1
0: 108 0 none Edge
Thanks and Regards,
Armin