D211DCX, 自己做的板子,参照官方原理图, 启动后进去系统后,热插拔tf卡,内核都会报错一次,而且是只报错一次,之后再插拔不会再报,报错信息如下
[aic@] # [ 20.856019] ------------[ cut here ]------------
[ 20.860687] WARNING: CPU: 0 PID: 0 at kernel/softirq.c:174 __local_bh_enable_ip+0x34/0x60
[ 20.868861] Modules linked in:
[ 20.871941] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.44 #1
[ 20.877778] epc: ffffffff800260d2 ra : ffffffff8035a716 sp : ffffffff805d7ab0
[ 20.884916] gp : ffffffff8069c978 tp : ffffffff805dc640 t0 : 0000000000000040
[ 20.892140] t1 : 0000000000000000 t2 : 0000000010000000 s0 : ffffffff805d7ae0
[ 20.899363] s1 : 0000000000000000 a0 : ffffffff8035a6f8 a1 : 0000000000000200
[ 20.906586] a2 : 0000000000040000 a3 : 00000000000f0000 a4 : 0000000000010000
[ 20.913810] a5 : ffffffff805dc640 a6 : ffffffff80c00248 a7 : ffffffff80c00270
[ 20.921033] s2 : ffffffff81029800 s3 : ffffffff80930818 s4 : ffffffff81029c00
[ 20.928257] s5 : ffffffff80666810 s6 : ffffffff8091d400 s7 : 000000000000000a
[ 20.935481] s8 : ffffffff80692000 s9 : 0000000000000001 s10: 0000000000000000
[ 20.942704] s11: ffffffff80930818 t3 : 0000000000000002 t4 : 0000000000000402
[ 20.949926] t5 : ffffffff806573b0 t6 : ffffffff806573b8
[ 20.955244] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[ 20.963158] ---[ end trace cbdb6a4bdacedf88 ]---
[ 21.061622] mmc0: card b369 removed
/mnt/sdcard is unmounted
请问大家有没有碰到一样的问题呢
最近编辑记录 vertiny (2025-11-04 16:38:26)
离线
虽然没用过D211,也不知道原因,但从代码可以知道报错一次的原因是WARN_ON_ONCE宏定义,即in_irq返回非零值,表示在这个有关下半部的处理过程中,检查发现硬中断计数非0(处于中断上下文)?
kernel/softirq.c
void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
{
WARN_ON_ONCE(in_irq());
// ........略过后续代码
}
EXPORT_SYMBOL(__local_bh_enable_ip);include/linux/preempt.h
#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
/*
* Are we doing bottom half or hardware interrupt processing?
*
* in_irq() - We're in (hard) IRQ context
* in_softirq() - We have BH disabled, or are processing softirqs
* in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled
* in_serving_softirq() - We're in softirq context
* in_nmi() - We're in NMI context
* in_task() - We're in task context
*
* Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really
* should not be used in new code.
*/
#define in_irq() (hardirq_count())离线