Re: 2.6.5-rc3-mm1

Russell King
2004-03-31T07:25:21Z

On Tue, Mar 30, 2004 at 06:26:27PM -0800, Andrew Morton wrote:
> Andrew Morton <akpm@osdl.org> wrote:
> >
> > I'm thinking that this can be fixed from the other direction: just before
> > release_dev() calls close (dropping BKL), if tty->count==1, make the
> > going-away tty ineligible for concurrent lookups. Do that by setting
> > tty->driver->ttys[idx] to NULL. Maybe.
>
> Famous last word: Volia!

I suspect you may just be able to get away with this for serial drivers
using serial_core. However, I suspect it'll break non-serial_core using
serial drivers.

The serial drivers track the tty count themselves, so that they know
when to do the final close processing (why you may ask - because of
the blocking for DCD in the open code.) I wouldn't like to say what
would happen if ->open were called for a different tty structure for
the same port while ->close was in progress.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core