DAHDI: spin lock (dahdi_timer_lock) too long; kernel panic

Colleagues, tell me how to solve my problem - periodically the system reboots and the following messages appear in /var/log/messages:
Code:
kernel: spin lock 0xffffffff82b85d60    (dahdi_timer_lock) held by 0xfffff80045905000 (tid 100750) too long
kernel: panic: spin lock held too long

I use:
Code:
FreeBSD 12.2-RELEASE r366954 GENERIC  amd64
dahdi-2.4.0rc5_7
dahdi-kmod26-2.6.1.r10747_1
asterisk18-18.8.0_1
My hardware:
Digium Wildcard TE121 as "wcte12xp".
Here is file /usr/local/etc/dahdi/system.conf:
Code:
#
# DAHDI Configuration File
#
# This file is parsed by the DAHDI Configurator, dahdi_cfg
#
span=1,0,0,CCS,HDB3,CRC4
bchan=1-15,17-31
dchan=16
loadzone=us
defaultzone=us
echocanceller=mg2,1-15,17-31

Here is the initialization message:
Code:
dahdi: Version:
kernel: te12xp0: vendor=d161 device=8000 subvendor=ffffffff
kernel: te12xp0: <Wildcard TE121> port 0xd000-0xd0ff mem 0xf7520000-0xf75203ff irq 35 at device 8.0 on pci7
kernel: te12xp0: <6>Setting up global serial parameters for E1
kernel: te12xp0: <6>Found a Wildcard TE121
kernel: dahdi_echocan_mg2: Registered echo canceler 'MG2'
kernel: te12xp0: <6>Span configured for CCS/HDB3/CRC4
kernel: te12xp0: <6>Missed interrupt. Increasing latency to 5 ms in order to compensate.

Why am I getting this error and how can I fix it?

I would be grateful for your advice,
Ogogon.
 
... periodically the system reboots and the following messages appear in /var/log/messages:

kernel: spin lock 0xffffffff82b85d60 (dahdi_timer_lock) held by 0xfffff80045905000 (tid 100750) too long
kernel: panic: spin lock held too long

There is a closed but unresolved bug report:
.
It looks like the bug is present since 9.1-RELEASE.

There seems to be a workaround in comment 2, not sure if it's a feasible solution for your hardware setup or valid for 12.2-RELEASE, and it doesn't resolve the problem, it decreases the appearance. See comment 4.

You might want to report the problem in the PR, so it can be reopened.
 
I've same problem on stable/13-dd7b7807c periodically. But I haven't hardware card. I use DAHDI timer from misc/dahdi-kmod26 only for the Asterisk.

Code:
root@server:/var/crash# kgdb /boot/kernel/kernel /var/crash/vmcore.0
GNU gdb (GDB) 13.1 [GDB v13.1 for FreeBSD]
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:
spin lock 0xffffffff81e40360 (dahdi_timer_lock) held by 0xfffffe06bc0d1560 (tid 389351) too long
panic: spin lock held too long
cpuid = 8
time = 1684837826
KDB: stack backtrace:
#0 0xffffffff805f3795 at kdb_backtrace+0x65
#1 0xffffffff805aadc1 at vpanic+0x151
#2 0xffffffff805aac63 at panic+0x43
#3 0xffffffff80589c28 at _mtx_lock_indefinite_check+0x68
#4 0xffffffff805897d5 at _mtx_lock_spin_cookie+0xd5
#5 0xffffffff81e1f4bc at _process_masterspan+0x6c
#6 0xffffffff81e30725 at coretimer_func+0x1c5
#7 0xffffffff805c7523 at softclock_call_cc+0x133
#8 0xffffffff805c7989 at softclock+0x79
#9 0xffffffff8056cd7a at ithread_loop+0x25a
#10 0xffffffff80569b0e at fork_exit+0x7e
#11 0xffffffff8093e11e at fork_trampoline+0xe
ipmi0: Watchdog set returned 0xd5
Uptime: 147d13h51m44s
Dumping 20632 out of 261989 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%

__curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
55    __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu,
 
Back
Top