From patchwork Tue Dec 8 12:42:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Landley X-Patchwork-Id: 40619 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 0288DB7F47 for ; Tue, 8 Dec 2009 23:43:07 +1100 (EST) Received: from grelber.thyrsus.com (static-71-162-243-5.phlapa.fios.verizon.net [71.162.243.5]) by ozlabs.org (Postfix) with ESMTP id 432C4B7B6C for ; Tue, 8 Dec 2009 23:42:59 +1100 (EST) Received: from landley.net (localhost [127.0.0.1]) by grelber.thyrsus.com (Postfix) with ESMTP id 484649F0135; Tue, 8 Dec 2009 07:42:55 -0500 (EST) From: Rob Landley Organization: Boundaries Unlimited To: Benjamin Herrenschmidt Subject: [PATCH] Re: ZILOG serial port broken in 2.6.32 Date: Tue, 8 Dec 2009 06:42:50 -0600 User-Agent: KMail/1.11.2 (Linux/2.6.28-16-generic; KDE/4.2.2; x86_64; ; ) References: <200912060101.22515.rob@landley.net> <1260148248.2076.1348.camel@pasglop> In-Reply-To: <1260148248.2076.1348.camel@pasglop> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200912080642.52103.rob@landley.net> Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Sunday 06 December 2009 19:10:48 Benjamin Herrenschmidt wrote: > On Sun, 2009-12-06 at 01:01 -0600, Rob Landley wrote: > > Trying again with a few likely-looking cc's from the MAINTAINERS file: > > > > Summary: > > > > The PMACZILOG serial driver last worked in 2.6.28. It was broken by > > commit f751928e0ddf54ea4fe5546f35e99efc5b5d9938 by Alan Cox making bits > > of the tty layer dynamically allocated. The PMACZILOG driver wasn't > > properly converted, it works with interrupts disabled (for boot > > messages), but as soon as interrupts are enabled (PID 1 spawns) the next > > write to the serial console panics the kernel. > > Ah looks like I missed that... I'll dig. Thanks for the report. > > Cheers, > Ben. Ok, here's the fix. It's not the _right_ fix, but it Works For Me (tm) and I'll leave it to you guys to figure out what this _means_: Signed-off-by: Rob Landley That one line workaround makes the panic go away, and things seem to work fine from there. I note that pmac_zilog.c function pmz_receiv_chars() has the following chunk: /* Sanity check, make sure the old bug is no longer happening */ if (uap->port.state == NULL || uap->port.state->port.tty == NULL) { WARN_ON(1); (void)read_zsdata(uap); return NULL; } Which doesn't catch this because it's the write code path (not the read code path) that's running into this. Rob diff -ru build/packages/linux/drivers/serial/serial_core.c build/packages/linux2/drivers/serial/serial_core.c --- build/packages/linux/drivers/serial/serial_core.c 2009-12-02 21:51:21.000000000 -0600 +++ build/packages/linux2/drivers/serial/serial_core.c 2009-12-08 06:17:06.000000000 -0600 @@ -113,7 +113,7 @@ static void uart_tasklet_action(unsigned long data) { struct uart_state *state = (struct uart_state *)data; - tty_wakeup(state->port.tty); + if (state->port.tty) tty_wakeup(state->port.tty); } static inline void