All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: sparclinux@vger.kernel.org
Subject: [PATCH]: Serial OOPS fix
Date: Tue, 11 Oct 2005 01:33:01 +0000	[thread overview]
Message-ID: <20051010.183301.110676579.davem@davemloft.net> (raw)


Sven, please give this patch a try.

These wakeup calls were not only wrong, they were never possibly
necessary.  Because:

1) If the UART was stopped, any necessary wakups were done by
   the UART layer.

2) If the circular buffer was emptied, we did the proper wakeup
   when we emptied the buffer.

And this bogus uart_write_wakeup() call is how we can end up
dereferencing a NULL tty pointer via uart_tasklet_action()
which is scheduled by uart_write_wakeup().

It seems both the sunsab and sunzilog drivers have this problem.
sunsu does the right thing, which is not surprising since it's
mostly a duplicate of the 8250 driver which tends to be well
tested :-)

diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index e971156..ba9381f 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -274,7 +274,6 @@ static void transmit_chars(struct uart_s
 	if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
 		up->interrupt_mask1 |= SAB82532_IMR1_XPR;
 		writeb(up->interrupt_mask1, &up->regs->w.imr1);
-		uart_write_wakeup(&up->port);
 		return;
 	}
 
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index d754457..7653d6c 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -517,10 +517,9 @@ static void sunzilog_transmit_chars(stru
 	if (up->port.info = NULL)
 		goto ack_tx_int;
 	xmit = &up->port.info->xmit;
-	if (uart_circ_empty(xmit)) {
-		uart_write_wakeup(&up->port);
+	if (uart_circ_empty(xmit))
 		goto ack_tx_int;
-	}
+
 	if (uart_tx_stopped(&up->port))
 		goto ack_tx_int;
 

             reply	other threads:[~2005-10-11  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11  1:33 David S. Miller [this message]
2005-10-11 19:53 ` [PATCH]: Serial OOPS fix Sven Hartge
2005-10-11 19:56 ` David S. Miller

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=20051010.183301.110676579.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=sparclinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.