When looking at the code, I found two more issues: If enabling full debugging with echo 0xffff >/sys/module/wakelock/parameters/debug_mask unhappiness ensues:
[21474789.795000] wake_unlock: main [21474789.795000] BUG: spinlock trylock failure on UP on CPU#0, suspend/16 [21474789.795000] lock: c049c9b4, .magic: dead4ead, .owner: suspend/16, .owner_cpu: 0 [21474789.795000] [<c0034534>] (dump_stack+0x0/0x14) from [<c01927f4>] (spin_bug+0x90/0xcc) [21474789.795000] [<c0192764>] (spin_bug+0x0/0xcc) from [<c0192878>] (_raw_spin_trylock+0x48/0x54) [21474789.795000] r6:c02a3580 r5:c049c9b4 r4:00000000 [21474789.795000] [<c0192830>] (_raw_spin_trylock+0x0/0x54) from [<c0383d5c>] (_spin_lock_irqsave+0x5c/0x90) [21474789.795000] r4:c049c9c4 [21474789.795000] [<c0383d00>] (_spin_lock_irqsave+0x0/0x90) from [<c02a3580>] (print_active_locks+0x2c/0xc4) [21474789.795000] r7:60000093 r6:c049c7e4 r5:00000000 r4:00000000 [21474789.795000] [<c02a3554>] (print_active_locks+0x0/0xc4) from [<c02a372c>] (wake_unlock+0x114/0x154) [21474789.795000] r6:c049c7e4 r5:00000000 r4:c0a099b4 [21474789.795000] [<c02a3618>] (wake_unlock+0x0/0x154) from [<c02a429c>] (early_suspend+0xe8/0x138) [21474789.795000] r7:c78102a0 r6:c7865f5c r5:c049ca8c r4:60000013 [21474789.795000] [<c02a41b4>] (early_suspend+0x0/0x138) from [<c0062200>] (run_workqueue+0x124/0x228) Also, it would be nice if the code followed the convention of putting a blank line between local variable declarations and statements more consistently. Finally, I discussed kernel stability with Mickey. He's too nice to complain much about regressions, but they're hurting FSO's effort of getting MS5 done. Our choices for providing more stability include making a branch for FSO or to quickly clean up what we have now and have a short moratorium on potentially upsetting changes. I don't like branches and I don't think we have lots of regressions to fix before having a sane kernel again, so I'd prefer the latter solution. Patches that could cause trouble but that can be cleanly disabled could of course still be included. - Werner
