[I4L] dc_l1_init() double WORK_INIT kills off keyboard

From: Tonnerre Anklin
Date: Thu Nov 27 2003 - 21:23:51 EST


Salut,

Sometimes, dc_l1_init is called on an already initialized card state.
That wouldn't be too bad if there just wasn't that workqueue entry
which is going loopy then. This workqueue entry will have (amongst
others) the effect that no keyboard input will be accepted.

The fix here is to skip the work initialization if the work is already
in the work queue.

More on this patch can be found at
<URL:http://keepsake.keepsake.ch/~thunder/noyau/2.6.0-test11-ta1/dcl1_init_workqueue.xml>

Thunder

diff -Nur linux-2.6.0-test9-mm3/drivers/isdn/hisax/isdnl1.c linux-2.6.0-test9-mm3-ta1/drivers/isdn/hisax/isdnl1.c
--- linux-2.6.0-test9-mm3/drivers/isdn/hisax/isdnl1.c 2003-10-08 21:24:03.000000000 +0200
+++ linux-2.6.0-test9-mm3-ta1/drivers/isdn/hisax/isdnl1.c 2003-11-24 13:32:32.000000000 +0100
@@ -913,8 +913,10 @@
dc_l1_init(struct IsdnCardState *cs, struct dc_l1_ops *ops)
{
cs->dc_l1_ops = ops;
- INIT_WORK(&cs->work, ops->bh_func, cs);
- init_timer(&cs->dbusytimer);
+ if (!test_bit(0, &cs->work.pending) {
+ INIT_WORK(&cs->work, ops->bh_func, cs);
+ init_timer(&cs->dbusytimer);
+ }
cs->dbusytimer.function = (void *)(unsigned long) ops->dbusy_func;
cs->dbusytimer.data = (unsigned long) cs;
}

Attachment: signature.asc
Description: Digital signature