[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111221160323.1084e954@pyramind.ukuu.org.uk>
Date: Wed, 21 Dec 2011 16:03:23 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
"Ted Ts'o" <tytso@....edu>, Greg KH <greg@...ah.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
akpm@...ux-foundation.org,
linux-kernel <linux-kernel@...r.kernel.org>
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@...llo.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists