[lkml]   [2003]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 2.6] 1/3 Serio: claim serio early

I think that serio_dev in serio_open should claim serio before calling
"open" function as it has already been decided that (in case of success)
this serio belongs to that serio_dev. Otherwise it might try to find an
owner on its own, like i8042 module that calls serio_interrupt which in
turn will do serio_rescan. From that point on 2 instances may start
fighting over the same serio.

What you think about the patch below?


diff -urN --exclude-from=/usr/src/exclude 2.6.0-test4/drivers/input/serio/serio.c linux-2.6.0-test4/drivers/input/serio/serio.c
--- 2.6.0-test4/drivers/input/serio/serio.c 2003-08-22 21:53:29.000000000 -0500
+++ linux-2.6.0-test4/drivers/input/serio/serio.c 2003-08-22 22:58:37.000000000 -0500
@@ -204,9 +204,11 @@
/* called from serio_dev->connect/disconnect methods under serio_sem */
int serio_open(struct serio *serio, struct serio_dev *dev)
- if (serio->open(serio))
- return -1;
serio->dev = dev;
+ if (serio->open(serio)) {
+ serio->dev = NULL;
+ return -1;
+ }
return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:48    [W:0.062 / U:1.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site