Hello,
To have 2.6.24-rt4 and rt6 working without BUGs in dmesg I did some patching.
Probably this was wrong and I only masked some other problem.
I'm not a kernel specialist, so could you look at it?
Regards,
Jakub
---------- Przekazana wiadomość ----------
Temat: 2.6.25.4-rt4 problems
Data: poniedziałek, 2 czerwca 2008
Od: "Jakub W. Jozwicki" <jozwicki@aster.pl>
Do: tglx@timesys.com
Hello,
On my laptop I've been seeing constant flood of printk BUG from migh_sleep
coming from cpu_idle():
[ 121.955048] BUG: sleeping function called from invalid context swapper(0)
at kernel/rtmutex.c:739
[ 121.955048] in_atomic():1 [00000001], irqs_disabled():0
[ 121.955048] Pid: 0, comm: swapper Not tainted 2.6.25.4-rt6 #2
[ 121.955048] [<c0120f61>] __might_sleep+0xf1/0xf8
[ 121.955048] [<c0466a4c>] __rt_spin_lock+0x24/0x61
[ 121.955048] [<c0466a91>] rt_spin_lock+0x8/0xa
[ 121.955048] [<c013f00d>] pm_qos_requirement+0x10/0x29
[ 121.955048] [<c03a09a6>] menu_select+0x5d/0x7f
[ 121.955048] [<c039ff48>] cpuidle_idle_call+0x47/0x9b
[ 121.955048] [<c039ff01>] ? cpuidle_idle_call+0x0/0x9b
[ 121.955048] [<c01060ff>] cpu_idle+0xaf/0x106
[ 121.955048] [<c0453e5f>] rest_init+0x67/0x69
[ 121.955048] =======================
I have fixed it with:
--- linux-2.6.25.4/kernel/pm_qos_params.c 2008-05-15 17:00:12.000000000 +0200
+++ linux-2.6.25-k01/kernel/pm_qos_params.c 2008-06-01 19:51:37.180887278
+0200
@@ -192,12 +192,15 @@
*/
int pm_qos_requirement(int pm_qos_class)
{
- int ret_val;
+ int ret_val, locked;
unsigned long flags;
- spin_lock_irqsave(&pm_qos_lock, flags);
+ locked = preempt_count() > 0;
+ if (!locked)
+ spin_lock_irqsave(&pm_qos_lock, flags);
ret_val = pm_qos_array[pm_qos_class]->target_value;
- spin_unlock_irqrestore(&pm_qos_lock, flags);
+ if (!locked)
+ spin_unlock_irqrestore(&pm_qos_lock, flags);
return ret_val;
}
Oh, and so...