All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Aguirre <saaguirre@ti.com>
To: linux-omap@vger.kernel.org
Cc: Kevin Hilman <khilman@deeprootsystems.com>,
	Vikram Pandita <vikram.pandita@ti.com>,
	Paul Walmsley <paul@pwsan.com>, Tony Lindgren <tony@atomide.com>,
	Sergio Aguirre <saaguirre@ti.com>
Subject: [RFC part1/2 merge v2][PATCH 01/11] OMAP3: serial: Check for zero-based physical addr
Date: Mon,  8 Mar 2010 11:20:44 -0600	[thread overview]
Message-ID: <1268068854-13429-2-git-send-email-saaguirre@ti.com> (raw)
In-Reply-To: <1268068854-13429-1-git-send-email-saaguirre@ti.com>

This is for protecting a wrong mapping attempt of a zero-based
physical address.

The result is that, no serial port will be attempted to be mapped.

Also add an additional protection for NULL clocks before attempting
to enable them (if above condition applies)

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
 arch/arm/mach-omap2/serial.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index da77930..1ca4330 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
 		struct device *dev = &pdev->dev;
 		struct plat_serial8250_port *p = dev->platform_data;
 
+		/* Don't map zero-based physical address */
+		if (p->mapbase == 0) {
+			printk(KERN_WARNING "omap serial: No physical address"
+			       " for uart#%d, so skipping early_init...\n", i);
+			continue;
+		}
 		/*
 		 * Module 4KB + L4 interconnect 4KB
 		 * Static mapping, never released
@@ -727,6 +733,10 @@ void __init omap_serial_init_port(int port)
 	pdev = &uart->pdev;
 	dev = &pdev->dev;
 
+	/* Don't proceed if there's no clocks available */
+	if (!uart->ick || !uart->fck)
+		return;
+
 	omap_uart_enable_clocks(uart);
 
 	omap_uart_reset(uart);
-- 
1.6.3.3


  reply	other threads:[~2010-03-08 17:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 17:20 [RFC part1/2 merge v2][PATCH 00/11] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
2010-03-08 17:20 ` Sergio Aguirre [this message]
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 02/11] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 03/11] ARM: OMAP3630: PRCM: Add UART4 control bits Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 04/11] OMAP clock: Add uart4_ick/fck definitions for 3630 Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 05/11] OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 06/11] OMAP3: Add UART4 IRQ for 36xx chips Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 07/11] omap3: serial: Fix uart4 handling for 3630 Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 08/11] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 09/11] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 10/11] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
2010-03-08 17:20 ` [RFC part1/2 merge v2][PATCH 11/11] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
2010-03-08 17:22 ` [RFC part1/2 merge v2][PATCH 00/11] omap2/3/4: uart4 fixes + zoom2/3 changes Aguirre, Sergio

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=1268068854-13429-2-git-send-email-saaguirre@ti.com \
    --to=saaguirre@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    --cc=vikram.pandita@ti.com \
    /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.