On 14/06/18(Thu) 22:24, Naoki Fukaumi wrote: > Hi tech@, > > ipmi(4) enabled -current kernel gets following panic() on boot, > > panic: acquiring blockable sleep lock with spinlock or critical section held > (kernel_lock) &kernel_lock @ /home/fukaumi/src/sys/arch/amd64/amd64/intr.c:525 > Stopped at db_enter+0x12: popq %r11 > TID PID UID PRFLAGS PFLAGS CPU COMMAND > *423398 6970 0 0x14000 0x200 0 ipmicmd > db_enter(bd2a5f736e825eae,10,ffff8000212b6b90,282,8,ffffffff81561932) at > db_enter+0x12 > panic(20d,ffffffff81b62719,ffffffff81a3ba3b,ffffffff81deb598,ffffffff81b62718,ffffffff81ccb464) > at panic+0x138 > witness_checkorder(a2fe973e3a67ed63,ffffffff81a3ba3b,20d,0,ffffffff81deb390,ffff800000087380) > at witness_checkorder+0xd52 > ___mp_lock(ffff800000087380,ffff8000212b6d38,ffffffff81c97ff0,0,ffffffff817259d0,ffff8000212b6ce8) > at ___mp_lock+0x70 > intr_handler(c1f8564e515d4217,4,ffff80000008c280,0,6,ffff800000087380) at > intr_handler+0x4c > Xintr_ioapic_edge21_untramp(0,0,0,0,0,34b00) at > Xintr_ioapic_edge21_untramp+0x13d > i82489_readreg(8f7f922366a4de4b,0,10,ffff8000212b6e18,286,8) at > i82489_readreg+0x1a > lapic_delay(5ece2493000,2,ffffffff81584942,ffff8000212b > 6e50) at lapic_delay+0x72 > kcs_wait(e550ca8103c4e2f2,ffff800000093000,ffff8000212b19d8,ffff80000008ac00,0,8f78bfa91f4d0kcs_wait+0x75 > kcs_sendmsg(ff3b00327acc0e2e,ffff800000093000,ffff8000212b19d8,ffff8000212b6f20,ffffffff8114464e,ffff8000212b6ed0) > at kcs_sendmsg+0xce > ipmi_cmd_poll(ffffffff813fa090,ffff8000212b19d8,ffffffff811460ff,ffff8000212b6ef0,ff3b00327acc0e2e,ffff800000093000) > at ipmi_cmd_poll+0x5f > ipmi_cmd_wait_cb(ffff80000008ac00,1,ffffffff811462bf,ffff8000212b6f10,ffffffff813fa090,ffff8000212b19d8) > at ipmi_cmd_wait_cb+0xf > taskq_thread(0,0,ffffffff81889860,0,ffff8000212b19d8,ffffffff811462b0) at > taskq_thread+0x6d > end trace frame: 0x0, count: 2 > > > following diff fixes it.
The problem is because you have an interrupt handler trying to grab the KERNEL_LOCK(). I'd suggest using IPL_MPFLOOR instead of IPL_NONE when initializing the mutex.