Messages in this thread | | | Date | Wed, 21 Dec 2011 16:03:23 +0000 | From | Alan Cox <> | Subject | Re: [RFC][PATCH 7/7] serial, 8250: Mostly avoid wakeups from under port->lock |
| |
On Wed, 21 Dec 2011 11:57:46 +0100 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> While not a strict requirement (anymore), it is nice not to issue > wakeups (or have them connected by locks) from console output. > > This patch avoids doing most wakeups from under port->lock, which is > connected to 8250console_write(). Only seriously challenged UARTs will > still do the wakeup, but since I don't actually have such a creature, > I'm less inclined to fix it up.
Gak..
> + BUG_ON(!state); > + tty = state->port.tty; > + tty_kref_get(tty); > + spin_unlock_irqrestore(&up->port.lock, flags); > + tty_wakeup(tty); > + tty_kref_put(tty);
driver innards shouldn't know this stuff and this makes it worse rather than cleaning it up
The basic idea looks fine but I really don't want magic lock hackery in the 8250 driver. We need a way of generalising this so the code is cleaner and the locking internal knowledge stays out of the driver itself.
Also I think it's probably buggy - sending the x_char is forward progress so probably needs to cause a wakeup.
So for the moment NAK, but worthy of figuring out how to do it right
| |