Re: Patch: Fix serial module use count (2.4.16 _and_ 2.5)

Russell King
2001-11-30T10:57:54Z

On Fri, Nov 30, 2001 at 11:44:14AM +0100, Maciej W. Rozycki wrote:
> Here is a fix I'm using for 2.4. It was submitted to Alan once, then a
> discussion was performed with a conclusion like "that may be a temporary
> fix for 2.4, but it needs a complete rework for 2.5". I'm not sure if the
> patch went in anywhere.

Have you audited all the tty drivers in 2.4 to make sure that they clean
up safely?

I don't believe the serial code will clean up safely as it stands for
starters if block_til_ready in serial.c fails, leaving an interrupt
in use. Further attempts to open the serial device will probably fail.

Try this as any user with your patch applied:

$ stty -clocal -F /dev/ttyS0
$ cat /proc/interrupts
$ cat /dev/ttyS0
^c
$ cat /proc/interrupts

I think you'll find your serial port interrupt is still claimed, despite
the module being marked as not in use.

--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux