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 > +