public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: linux-kernel@vger.kernel.org
Subject: [CFT] Serial double initialisation
Date: Sat, 30 Nov 2002 23:50:31 +0000	[thread overview]
Message-ID: <20021130235031.C30365@flint.arm.linux.org.uk> (raw)

A while ago, Alan reported to me a double-initialisation bug between the
ISA init and PNP initialisation of serial ports.

Since then, Alan integrated a patch I sent him into -ac, and as yet I
haven't heard any feedback.  Since I don't have the PNP hardware to be
able to test this, I'm not putting it into Linus' tree until I hear some
success.

So, if people are using 2.5.50 with PNP support enabled, and if you are
seeing two "ttyS0" lines during the kernel boot messages, please apply
this patch and confirm to me that it correctly reports one ttyS0 message.

This is the exact same patch I sent to Alan, and appears to apply cleanly
to the current 2.5.50 BK tree.

Hopefully looking forward to some feedback.

Thanks.

--- orig/drivers/serial/core.c	Tue Nov  5 12:51:26 2002
+++ linux/drivers/serial/core.c	Mon Nov 25 11:44:08 2002
@@ -2405,17 +2405,22 @@
 			goto out;
 		}
 
-		state->port->iobase   = port->iobase;
-		state->port->membase  = port->membase;
-		state->port->irq      = port->irq;
-		state->port->uartclk  = port->uartclk;
-		state->port->fifosize = port->fifosize;
-		state->port->regshift = port->regshift;
-		state->port->iotype   = port->iotype;
-		state->port->flags    = port->flags;
-		state->port->line     = state - drv->state;
+		/*
+		 * If the port is already initialised, don't touch it.
+		 */
+		if (state->port->type == PORT_UNKNOWN) {
+			state->port->iobase   = port->iobase;
+			state->port->membase  = port->membase;
+			state->port->irq      = port->irq;
+			state->port->uartclk  = port->uartclk;
+			state->port->fifosize = port->fifosize;
+			state->port->regshift = port->regshift;
+			state->port->iotype   = port->iotype;
+			state->port->flags    = port->flags;
+			state->port->line     = state - drv->state;
 
-		__uart_register_port(drv, state, state->port);
+			__uart_register_port(drv, state, state->port);
+		}
 
 		ret = state->port->line;
 	} else


-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


             reply	other threads:[~2002-11-30 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-30 23:50 Russell King [this message]
2002-12-01  0:45 ` [CFT] Serial double initialisation Zwane Mwaikambo

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=20021130235031.C30365@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox