mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Phil Oester <kernel@linuxace.com>,
	linux-kernel@vger.kernel.org, trini@kernel.crashing.org
Subject: Re: Garbage on serial console after serial driver loads
Date: Tue, 03 May 2005 15:17:12 +0100	[thread overview]
Message-ID: <1115129833.4446.23.camel@hades.cambridge.redhat.com> (raw)
In-Reply-To: <20050328200243.C2222@flint.arm.linux.org.uk>

On Mon, 2005-03-28 at 20:02 +0100, Russell King wrote:
> Is this patch ok for you?

Not really; it's just a quick hack applied without any real
consideration of the problem. If we're messing up the baud rate when we
change the master clock, then just make it change the divisor
accordingly at the same time. We don't seem to store the active
parameters of the serial console anywhere useful; we can do it just by
reading back the divisor and multiplying by eight though...

Tom, does this also mean you don't need the 'ifndef ppc'?

--- linux/drivers/serial/8250.c~	2004-10-18 22:53:08.000000000 +0100
+++ linux/drivers/serial/8250.c	2005-05-03 13:54:39.394011032 +0100
@@ -567,13 +567,25 @@ static void autoconfig_16550a(struct uar
 
 		if ((status2 ^ status1) & UART_MCR_LOOP) {
 #ifndef CONFIG_PPC
+			unsigned short quot;
+
 			serial_outp(up, UART_LCR, 0xE0);
 			status1 = serial_in(up, 0x04); /* EXCR1 */
 			status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
 			status1 |= 0x10;  /* 1.625 divisor for baud_base --> 921600 */
 			serial_outp(up, 0x04, status1);
-			serial_outp(up, UART_LCR, 0);
 			up->port.uartclk = 921600*16;
+			
+			/* Adjust the baud rate to match, in case we're
+			   already using the port */
+			quot = serial_inp(up, UART_DLM) << 8;
+			quot += serial_inp(up, UART_DLL);
+			quot <<= 3;
+			serial_outp(up, UART_DLL, quot & 0xff);
+			serial_outp(up, UART_DLM, quot >> 8);
+
+			serial_outp(up, UART_LCR, 0);
+
 #endif
 
 			up->port.type = PORT_NS16550A;


-- 
dwmw2


  parent reply	other threads:[~2005-05-03 14:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28 17:36 Phil Oester
2005-03-28 19:02 ` Russell King
2005-03-28 23:57   ` Dave Airlie
2005-05-03 14:17   ` David Woodhouse [this message]
2005-05-03 15:04     ` Phil Oester
2005-05-03 15:11     ` Tom Rini
2005-05-03 15:23       ` David Woodhouse
2005-05-03 16:00         ` Tom Rini
2005-05-03 16:16       ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2005-03-27 11:11 Jan Engelhardt
2005-03-25 20:24 Luca
2005-03-25 20:38 ` Russell King
2005-03-25 21:01   ` Luca
2005-03-26 10:16     ` Jan Engelhardt
2005-03-26 14:35       ` Luca
2005-03-26 15:10       ` Russell King
2005-03-26 15:55         ` Phil Oester
2005-03-26 16:37           ` Russell King
2005-03-26 17:19             ` Phil Oester
2005-03-26 17:22             ` Phil Oester
2005-04-13 12:45           ` Paul Slootman
2005-04-18 20:21             ` Phil Oester
2005-04-18 23:14             ` David Woodhouse

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=1115129833.4446.23.camel@hades.cambridge.redhat.com \
    --to=dwmw2@infradead.org \
    --cc=kernel@linuxace.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=trini@kernel.crashing.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

all inboxes | Powered by JetHome®