From: Rob Landley <rob@landley.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] Re: ZILOG serial port broken in 2.6.32
Date: Tue, 8 Dec 2009 06:42:50 -0600 [thread overview]
Message-ID: <200912080642.52103.rob@landley.net> (raw)
In-Reply-To: <1260148248.2076.1348.camel@pasglop>
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 <rob@landley.net>
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
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
--
Latency is more important than throughput. It's that simple. - Linus Torvalds
next prev parent reply other threads:[~2009-12-08 12:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 7:01 ZILOG serial port broken in 2.6.32 Rob Landley
2009-12-07 1:10 ` Benjamin Herrenschmidt
2009-12-07 20:25 ` Rob Landley
2009-12-08 12:42 ` Rob Landley [this message]
2010-01-08 3:00 ` [PATCH] " Benjamin Herrenschmidt
2010-01-09 8:17 ` Rob Landley
2010-01-11 3:02 ` Benjamin Herrenschmidt
2010-01-11 7:22 ` Rob Landley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912080642.52103.rob@landley.net \
--to=rob@landley.net \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).