public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matt Tolentino <matthew.e.tolentino@intel.com>,
	David Mosberger <davidm@hpl.hp.com>
Subject: Re: [PATCH] Add PCDP console detection support
Date: Mon, 28 Jun 2004 16:55:55 +0000	[thread overview]
Message-ID: <200406281055.55226.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <20040626111527.B21799@flint.arm.linux.org.uk>

On Saturday 26 June 2004 4:15 am, Russell King wrote:
> On Fri, Jun 25, 2004 at 03:04:50PM -0600, Bjorn Helgaas wrote:
> > This moves the code from drivers/serial/8250_hcdp.[ch] to
> > drivers/firmware/pcdp.[ch], since it's no longer 8250-specific.
> > It also obsoletes CONFIG_SERIAL_8250_HCDP, replacing it with
> > CONFIG_EFI_PCDP (which defaults to Y for ia64).
> 
> I'm happy with this.  The only thing I spotted on a quick read through
> was:
> ...
> What if ioremap fails (can it fail here?)
> ...
> Should be UPIO_MEM please.  Seems I missed this in the HCDP code...
> ...
> Likewise should be UPIO_PORT please.

OK, Andrew, can you apply the following additional patch to address
the things Russell found (thanks, Russell)?

Check for ioremap failure and use correct UPIO_{MEM,PORT} constants.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

=== drivers/firmware/pcdp.c 1.1 vs edited ==--- 1.1/drivers/firmware/pcdp.c	2004-06-27 11:52:01 -06:00
+++ edited/drivers/firmware/pcdp.c	2004-06-28 10:46:25 -06:00
@@ -56,6 +56,7 @@
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 	struct uart_port port;
 	static char options[16];
+	int mapsize = 64;
 
 	memset(&port, 0, sizeof(port));
 	port.uartclk = uart->clock_rate;
@@ -64,11 +65,16 @@
 
 	if (uart->addr.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY) {
 		port.mapbase = uart->addr.address;
-		port.membase = ioremap(port.mapbase, 64);
-		port.iotype = SERIAL_IO_MEM;
+		port.membase = ioremap(port.mapbase, mapsize);
+		if (!port.membase) {
+			printk(KERN_ERR "%s: couldn't ioremap 0x%lx-0x%lx\n",
+				__FUNCTION__, port.mapbase, port.mapbase + mapsize);
+			return;
+		}
+		port.iotype = UPIO_MEM;
 	} else if (uart->addr.address_space_id = ACPI_ADR_SPACE_SYSTEM_IO) {
 		port.iobase = uart->addr.address;
-		port.iotype = SERIAL_IO_PORT;
+		port.iotype = UPIO_PORT;
 	} else
 		return;
 
@@ -102,7 +108,7 @@
 	add_preferred_console("ttyS", port.line, options);
 
 	printk(KERN_INFO "PCDP: serial console at %s 0x%lx (ttyS%d, options %s)\n",
-		port.iotype = SERIAL_IO_MEM ? "MMIO" : "I/O",
+		port.iotype = UPIO_MEM ? "MMIO" : "I/O",
 		uart->addr.address, port.line, options);
 #endif
 }

  reply	other threads:[~2004-06-28 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 21:04 [PATCH] Add PCDP console detection support Bjorn Helgaas
2004-06-26 10:15 ` Russell King
2004-06-28 16:55   ` Bjorn Helgaas [this message]
2004-07-05  1:14 ` peterc

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=200406281055.55226.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@osdl.org \
    --cc=davidm@hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.e.tolentino@intel.com \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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