Tool/software:
Hi,
We are using TCAN4450 module is integrated in IMX8DXL processor. The TCAN module is successfully initialized but unable to send the data(TX) and RX is happenening is correctly.
When we are trying to send the message (TX) from the processor, observed TCAN panic.
Below is the dts configuration.
&lpspi3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi3>;
fsl,spi-num-chipselects = <1>;
spi-max-frequency = <6000000>;
cs-gpios = <&lsio_gpio0 16 GPIO_ACTIVE_HIGH>;
status = "okay";
tcan4x5x1: tcan4x5x@0 {
compatible = "ti,tcan4x5x";
reg = <0>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <4000000>;
bosch,mram-cfg = <0x0 3 2 28 10 0 20 12>;
clocks = <&hclk>, <&cclk>;
clock-names = "hclk", "cclk";
interrupt-parent = <&lsio_gpio3>;
interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
data-ready-gpios = <&lsio_gpio3 18 GPIO_ACTIVE_HIGH>;
reset-gpios = <&exp2 11 GPIO_ACTIVE_HIGH>;
iw-tcan-prop;
wakeup-source;
status = "okay";
};
};
And below is the PANIC when trying to send the data
root@imx8dxl-iwg46s:~# insmod /run/media/mmcblk0p1/tcan4x5x.ko
[ 25.051965] inside probe-----------
[ 25.409155] tcan4x5x spi3.0: m_can device registered (irq=215, version=32)
[ 25.419456] tcan4x5x spi3.0 can3: TCAN4X5X successfully initialized.
root@imx8dxl-iwg46s:~#
root@imx8dxl-iwg46s:~# ip link set can3 up type can bitr[ 33.851928] can-3v3: disabling
[ 33.855019] vref_1v8: disabling
[ 33.858219] usb_otg1_vbus: disabling
ate 250000
[ 36.234793] IPv6: ADDRCONF(NETDEV_CHANGE): can3: link becomes ready
root@imx8dxl-iwg46s:~# cansend can3 123#aabbccddee
[ 42.931517] begining-----
[ 42.934202] handler begining---------------------
[ 42.938970] 11th bit identifier
[ 42.938977] else part of version----------------
[ 42.946910] BUG: scheduling while atomic: cansend/447/0x00000203
[ 42.952990] Modules linked in: tcan4x5x
[ 42.956893] CPU: 1 PID: 447 Comm: cansend Not tainted 5.15.52+gf266012f09d6 #129
[ 42.964318] Hardware name: iW-RainboW-G46M-i.MX8DXL OSM (DT)
[ 42.969983] Call trace:
[ 42.972429] dump_backtrace+0x0/0x1a0
[ 42.976116] show_stack+0x1c/0x70
[ 42.979451] dump_stack_lvl+0x68/0x84
[ 42.983124] dump_stack+0x1c/0x38
[ 42.986454] __schedule_bug+0x60/0x80
[ 42.990126] __schedule+0x658/0x710
[ 42.993627] schedule+0x74/0x110
[ 42.996869] schedule_timeout+0x80/0xf0
[ 43.000716] wait_for_completion_timeout+0x80/0x10c
[ 43.005607] fsl_lpspi_transfer_one+0x4c8/0x6e0
[ 43.010153] spi_transfer_one_message+0x174/0x1d0
[ 43.014868] __spi_pump_messages.constprop.0+0x264/0x50c
[ 43.020195] __spi_sync+0x18c/0x1c0
[ 43.023694] spi_write_then_read+0xf8/0x1e0
[ 43.027890] tcan4x5x_regmap_read+0x3c/0x64 [tcan4x5x]
[ 43.033051] _regmap_raw_read+0xd8/0x17c
[ 43.036986] _regmap_bus_read+0x48/0x80
[ 43.040835] _regmap_read+0x64/0xf0
[ 43.044338] regmap_read+0x50/0x80
[ 43.047752] tcan4x5x_read_reg+0x34/0x60 [tcan4x5x]
[ 43.052652] m_can_tx_handler+0x298/0x89c
[ 43.056672] m_can_start_xmit+0xac/0x14c
[ 43.060610] dev_hard_start_xmit+0xd8/0x160
[ 43.064803] sch_direct_xmit+0xe8/0x36c
[ 43.068652] __dev_queue_xmit+0x524/0xb6c
[ 43.072677] dev_queue_xmit+0x18/0x24
[ 43.076351] can_send+0xc0/0x260
[ 43.079592] raw_sendmsg+0x140/0x30c
[ 43.083180] sock_write_iter+0xa4/0x110
[ 43.087028] new_sync_write+0x174/0x184
[ 43.090877] vfs_write+0x230/0x29c
[ 43.094291] ksys_write+0xdc/0xf4
[ 43.097618] __arm64_sys_write+0x20/0x2c
[ 43.101554] invoke_syscall+0x48/0x114
[ 43.105313] el0_svc_common.constprop.0+0xd4/0xfc
[ 43.110033] do_el0_svc+0x2c/0x94
[ 43.113361] el0_svc+0x28/0x80
[ 43.116427] el0t_64_sync_handler+0xa8/0x130
[ 43.120707] el0t_64_sync+0x1a0/0x1a4
[ 43.124997] putidx 0000 0000 0000 0000 0000 0000 0000 0000
[ 43.132847] M_CAN_TXFQS0000 0000 0000 0000 0000 0000 0000 1100
[ 43.139491] M_CAN_FIFO_ID,------------0011 0010 0001 0101 0000 0011 0010 0000
[ 43.147313] After---- M_CAN_FIFO_ID,------------0011 0010 0001 0101 0000 0011 0010 0000
[ 43.155643] before fifo write----------------------------
[ 43.161333] after fifo write-----------------------------
[ 43.166784] inside for loop fifo write-------------------------
[ 43.172771] inside for loop fifo write-------------------------
[ 43.178959] beg of delay-------------------------------
[ 43.184270] end of delay--------------------------
[ 43.189777] not full------------
[ 43.193134] ------------[ cut here ]------------
[ 43.193139] WARNING: CPU: 0 PID: 447 at kernel/softirq.c:362 __local_bh_enable_ip+0xac/0xbc
[ 43.193164] Modules linked in:
[ 43.193168] tcan4x5x
[ 43.209194]
[ 43.209202] CPU: 0 PID: 447 Comm: cansend Tainted: G W 5.15.52+gf266012f09d6 #129
[ 43.209213] Hardware name: iW-RainboW-G46M-i.MX8DXL OSM (DT)
[ 43.209218] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 43.209227] pc : __local_bh_enable_ip+0xac/0xbc
[ 43.209240] lr : __dev_queue_xmit+0x424/0xb6c
[ 43.209250] sp : ffff80000af5bb20
[ 43.209253] x29: ffff80000af5bb20 x28: ffff000005f38000 x27: 0000000000000000
[ 43.209268] x26: ffff000005c59028 x25: ffff000005b91000 x24: 0000000000000010
[ 43.209283] x23: ffff000005b91000 x22: ffff000005e99e00 x21: ffff000005b90400
[ 43.209300] x20: 0000000000000000 x19: ffff000005c59000 x18: 0000000000000003
[ 43.209314] x17: 0000000000001aeb x16: 0000000000000113 x15: 000000b4caf04ccf
[ 43.209329] x14: 0000000000000245 x13: 0000000000000000 x12: 0000000000000000
[ 43.209343] x11: 0000000000000002 x10: 0000000000000990 x9 : ffff80000af5b7a0
[ 43.209359] x8 : ffff000005f389f0 x7 : ffff000005b90540 x6 : ffff000005b90780
[ 43.209378] x5 : 000000000000000a x4 : 000000000000000a x3 : ffff000005b904d8
[ 43.209391] x2 : 0000000000000000 x1 : 0000000000000200 x0 : 00000000fffffffe
[ 43.209409] Call trace:
[ 43.209414] __local_bh_enable_ip+0xac/0xbc
[ 43.209425] __dev_queue_xmit+0x424/0xb6c
[ 43.209435] dev_queue_xmit+0x18/0x24
[ 43.209445] can_send+0xc0/0x260
[ 43.209456] raw_sendmsg+0x140/0x30c
[ 43.209465] sock_write_iter+0xa4/0x110
[ 43.209480] new_sync_write+0x174/0x184
[ 43.209494] vfs_write+0x230/0x29c
[ 43.209505] ksys_write+0xdc/0xf4
[ 43.209518] __arm64_sys_write+0x20/0x2c
[ 43.209529] invoke_syscall+0x48/0x114
[ 43.209540] el0_svc_common.constprop.0+0xd4/0xfc
[ 43.209554] do_el0_svc+0x2c/0x94
[ 43.209567] el0_svc+0x28/0x80
[ 43.209578] el0t_64_sync_handler+0xa8/0x130
[ 43.209586] el0t_64_sync+0x1a0/0x1a4
[ 43.209595] ---[ end trace 1101eba41d86a994 ]---
[ 43.209712] Unable to handle kernel paging request at virtual address 0000ffff84049df0
[ 43.209726] Mem abort info:
[ 43.209728] ESR = 0x82000007
[ 43.209731] EC = 0x20: IABT (lower EL), IL = 32 bits
[ 43.209737] SET = 0, FnV = 0
[ 43.209741] EA = 0, S1PTW = 0
[ 43.209744] FSC = 0x07: level 3 translation fault
[ 43.209749] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000094a20000
[ 43.209755] [0000ffff84049df0] pgd=0800000085ee3003, p4d=0800000085ee3003, pud=0800000085c1d003, pmd=0800000085c25003, pte=0000000000000000
[ 43.209776] Internal error: Oops: 82000007 [#1] PREEMPT SMP
[ 43.209782] Modules linked in: tcan4x5x
[ 43.209790] CPU: 0 PID: 447 Comm: cansend Tainted: G W 5.15.52+gf266012f09d6 #129
[ 43.209799] Hardware name: iW-RainboW-G46M-i.MX8DXL OSM (DT)
[ 43.209803] pstate: 20000000 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 43.209812] pc : 0000ffff84049df0
[ 43.209815] lr : 0000ffff83fd06d0
[ 43.209817] sp : 0000ffffd6ba8250
[ 43.209820] x29: 0000ffffd6ba8250 x28: 0000ffff8417c350 x27: 0000aaaad3e13b88
[ 43.209834] x26: 0000ffffd6ba82d0 x25: 0000000000000000 x24: 0000ffff8417aaf8
[ 43.209850] x23: 0000ffff8412c000 x22: 0000000000000004 x21: 0000ffff8412c748
[ 43.209864] x20: 0000aaaad3e14008 x19: 0000ffff8412c728 x18: fffffffffffff000
[ 43.209881] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffff84175da0
[ 43.209894] x14: 0000ffff8417c000 x13: 0000ffff8417bb60 x12: 0000ffff841740b0
[ 43.209909] x11: 0000ffffd6ba82c0 x10: 0000210000000000 x9 : 0000ffffd6ba82bf
[ 43.209924] x8 : 0000000000000020 x7 : 0000ffff8417c930 x6 : 0000ffff8417c350
[ 43.209939] x5 : 000000000000017f x4 : 0000ffff8417bab0 x3 : 0000000000000000
[ 43.209953] x2 : 0000ffff8412cb60 x1 : 0000000000000001 x0 : 0000aaaad3e14008
[ 43.546303] ---[ end trace 1101eba41d86a995 ]---
[ 43.546310] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[ 43.546316] SMP: stopping secondary CPUs
[ 43.546324] Kernel Offset: disabled
[ 43.546327] CPU features: 0x00000001,20000846
[ 43.546333] Memory Limit: none
[ 43.572634] ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---