Re: VIOLENT 2.1.129 serial bug on Alpha.

Theodore Y. Ts'o (tytso@mit.edu)
Mon, 23 Nov 1998 16:15:57 -0500


Date: Sun, 22 Nov 1998 23:51:38 -0600 (CST)
From: Bibek Sahu <scorpio@dodds.net>

Violent as in when it hits, it takes out everything down to Init,
and the only way out is to hit the reset button.

Steps that I think it followed:

1.) Compile serial as a module, let kmod handle it.
2.) Disconnect everything from ttyS0.
3.) Run getty on /dev/ttyS0 (in /etc/inittab)
4.) Open /dev/ttyS0 with something, say minicom.
5.) Try to remove unused modules (e.g., rmmod -a)
6.) Try to start / stop any program.
7.) Crash. HARD!

I think this patch should solve the problem. It's sounds similar to a
problem reported to me by Maciej W. Rozycki last week. If so, it's a
long-standing serial driver problem which occurs only if you are using
it as a module.

There are a few cases where the module use count gets decremented more
than it should. Why this causes a oops afterwards I'm not entirely
sure, but I looked over the code paths which Maciej pointed out to me,
and sure enough, they do over-decrement the module use count.

Linus, could you apply these patches to the 2.1 source tree? Thanks!!

And Bibek, if you could let me know whether or not this patch solves yor
problem, I'd appreciate it. Your symptoms sound exactly the same as
Maciej's, though, so I'm pretty sure this should do it, though.

- Ted

Patch generated: on Mon Nov 23 16:11:17 EST 1998 by tytso@rsts-11.mit.edu
against Linux version 2.1.128

RCS file: drivers/char/RCS/serial.c,v
retrieving revision 1.1
diff -u -r1.1 drivers/char/serial.c
--- drivers/char/serial.c 1998/11/20 17:27:15 1.1
+++ drivers/char/serial.c 1998/11/20 17:29:03
@@ -2581,10 +2581,8 @@
}
tty->driver_data = info;
info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "rs_open")) {
- MOD_DEC_USE_COUNT;
+ if (serial_paranoia_check(info, tty->device, "rs_open"))
return -ENODEV;
- }

#ifdef SERIAL_DEBUG_OPEN
printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
@@ -2631,7 +2629,6 @@

retval = block_til_ready(tty, filp, info);
if (retval) {
- MOD_DEC_USE_COUNT;
#ifdef SERIAL_DEBUG_OPEN
printk("rs_open returning after block_til_ready with %d\n",
retval);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/