
From: Alexander Nyberg <alexn@dsv.su.se>

When running a Posix conformance test (from posixtestsuite), the kernel
locks up with:

BUG: soft lockup detected on CPU#0

Pid:  1873, comm: 10-1.test
EIP: 0060:[<c0126fda>] CPU: 0
EIP is at sys_timer_settime+0xfa+0x1f0
 EFLAGS: 00000282  Not tainted (2.6.11-rc3-mm2)
EAX: 00000282 EBX: 00000001 ECX: ffffffff EDX: 00000000
ESI: 00000000 EDI: 00000000 EBP: f17eafbc DS: 007b ES: 007b
CR0: 8005003b CR2: b7fac1f0 CR3: 311b3000 CR4: 000006d0

in test conformance/interfaces/timer_create/10-1.c (attached).

The problem arises from code touching the union in alloc_posix_timer() 
which makes firing go non-zero. When firing is checked in posix_cpu_timer_set()
it will be positive causing an infinite loop.

So either the below fix or preferably move the INIT_LIST_HEAD(x) from
alloc_posix_timer() to somewhere later where it doesn't disturb the other
union members.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/kernel/posix-cpu-timers.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN kernel/posix-cpu-timers.c~posix-timers-cpu-clock-support-for-posix-timers-fix2 kernel/posix-cpu-timers.c
--- 25/kernel/posix-cpu-timers.c~posix-timers-cpu-clock-support-for-posix-timers-fix2	2005-02-21 15:54:34.000000000 -0800
+++ 25-akpm/kernel/posix-cpu-timers.c	2005-02-21 15:54:34.000000000 -0800
@@ -312,6 +312,7 @@ int posix_cpu_timer_create(struct k_itim
 	INIT_LIST_HEAD(&new_timer->it.cpu.entry);
 	new_timer->it.cpu.incr.sched = 0;
 	new_timer->it.cpu.expires.sched = 0;
+	new_timer->it.cpu.firing = 0;
 
 	read_lock(&tasklist_lock);
 	if (CPUCLOCK_PERTHREAD(new_timer->it_clock)) {
_
