Re: [PATCH 06/14] tty/serial/core: Introduce poll_init callback

2012-09-10 Thread Alan Cox
> > What stops a parallel open or close changing ASYNC_INITIALIZED after you > > test and before you lock ? > > Yeah, I should do the whole thing under the mutex. Can you use test_bit() as well. I'm trying to gradually push all the code that way so people habitually use set_bit() and we don't get

Re: [PATCH 06/14] tty/serial/core: Introduce poll_init callback

2012-09-10 Thread Anton Vorontsov
On Mon, Sep 10, 2012 at 12:13:20PM +0100, Alan Cox wrote: > > + tport = &state->port; > > + if (!(tport->flags & ASYNC_INITIALIZED) && port->ops->poll_init) { > > + mutex_lock(&tport->mutex); > > + ret = port->ops->poll_init(port); > > + /* > > +* We do

Re: [PATCH 06/14] tty/serial/core: Introduce poll_init callback

2012-09-10 Thread Alan Cox
> + tport = &state->port; > + if (!(tport->flags & ASYNC_INITIALIZED) && port->ops->poll_init) { > + mutex_lock(&tport->mutex); > + ret = port->ops->poll_init(port); > + /* > + * We don't set ASYNCB_INITIALIZED as we only initialized the > +

[PATCH 06/14] tty/serial/core: Introduce poll_init callback

2012-09-09 Thread Anton Vorontsov
It was noticed that polling drivers (like KGDB) are not able to use serial ports if the ports were not previously initialized via console. I.e. when booting with console=ttyAMA0 kgdboc=ttyAMA0, everything works fine, but with console=ttyFOO kgdboc=ttyAMA0, the kgdboc doesn't work. This is because