public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Daniel Drake <dsd@laptop.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org,
	Andres Salomon <dilinger@queued.net>,
	tglx@linutronix.de, x86@kernel.org
Subject: Re: OLPC power management patches - merge for 3.1?
Date: Sun, 24 Jul 2011 09:27:29 +0200	[thread overview]
Message-ID: <20110724072729.GA21281@elte.hu> (raw)
In-Reply-To: <CAGq3pz4VHgagUQ+jGJdt9LL4UnFt+CDgcLLXbuVeKfWMc=0wAA@mail.gmail.com>


* Daniel Drake <dsd@laptop.org> wrote:

> Hi,
> 
> Many thanks for committing the OLPC power management patches to
> linux-tip a few weeks ago.
> 
> Even though they were never merged into the master branch of linux-tip

it's excluded because in testing i found a boot crash with it.  
Thomas did a quick fix for it but i have not heard about it since 
then - Thomas/Peter, is this all resolved in x86/olpc?

(There's also the build failure Randy reported.)

> (where I presume linux-next pulls from), they have been included in 
> linux-next for even longer via Andrew Morton's tree.

Andrew probably thought they were missed - they werent.

Thanks,

	Ingo

------------->
Subject: drivers/serial/apbuart: Fix boot crash
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 16 Dec 2010 12:38:03 +0100

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/serial/apbuart.c |   58 ++++++++++++++++++-----------------------------
 1 file changed, 23 insertions(+), 35 deletions(-)

Index: linux-2.6-tip/drivers/serial/apbuart.c
===================================================================
--- linux-2.6-tip.orig/drivers/serial/apbuart.c
+++ linux-2.6-tip/drivers/serial/apbuart.c
@@ -593,71 +593,57 @@ static struct of_platform_driver grlib_a
 };
 
 
-static void grlib_apbuart_configure(void)
+static int grlib_apbuart_configure(void)
 {
-	static int enum_done;
 	struct device_node *np, *rp;
-	struct uart_port *port = NULL;
 	const u32 *prop;
-	int freq_khz;
-	int v = 0, d = 0;
-	unsigned int addr;
-	int irq, line;
-	struct amba_prom_registers *regs;
-
-	if (enum_done)
-		return;
+	int freq_khz, line = 0;
 
 	/* Get bus frequency */
 	rp = of_find_node_by_path("/");
+	if (!rp)
+		return -ENODEV;
 	rp = of_get_next_child(rp, NULL);
+	if (!rp)
+		return -ENODEV;
 	prop = of_get_property(rp, "clock-frequency", NULL);
+	if (!prop)
+		return -ENODEV;
 	freq_khz = *prop;
 
-	line = 0;
 	for_each_matching_node(np, apbuart_match) {
+		const int *irqs = of_get_property(np, "interrupts", NULL);
+		const struct amba_prom_registers *regs;
+		struct uart_port *port;
 
-		int *vendor = (int *) of_get_property(np, "vendor", NULL);
-		int *device = (int *) of_get_property(np, "device", NULL);
-		int *irqs = (int *) of_get_property(np, "interrupts", NULL);
-		regs = (struct amba_prom_registers *)
-		    of_get_property(np, "reg", NULL);
-
-		if (vendor)
-			v = *vendor;
-		if (device)
-			d = *device;
+		regs = of_get_property(np, "reg", NULL);
 
 		if (!irqs || !regs)
-			return;
+			return -ENODEV;
 
 		grlib_apbuart_nodes[line] = np;
 
-		addr = regs->phys_addr;
-		irq = *irqs;
-
 		port = &grlib_apbuart_ports[line];
-
-		port->mapbase = addr;
-		port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
-		port->irq = irq;
+		port->mapbase = regs->phys_addr;
+		port->membase = ioremap(regs->phys_addr,
+					sizeof(struct grlib_apbuart_regs_map));
+		port->irq = *irqs;
 		port->iotype = UPIO_MEM;
 		port->ops = &grlib_apbuart_ops;
 		port->flags = UPF_BOOT_AUTOCONF;
 		port->line = line;
 		port->uartclk = freq_khz * 1000;
-		port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line);
+		port->fifosize =
+			apbuart_scan_fifo_size((struct uart_port *) port, line);
 		line++;
 
 		/* We support maximum UART_NR uarts ... */
 		if (line == UART_NR)
 			break;
-
 	}
 
-	enum_done = 1;
-
 	grlib_apbuart_driver.nr = grlib_apbuart_port_nr = line;
+	return line ? 0 : -ENODEV;
 }
 
 static int __init grlib_apbuart_init(void)
@@ -665,7 +651,9 @@ static int __init grlib_apbuart_init(voi
 	int ret;
 
 	/* Find all APBUARTS in device the tree and initialize their ports */
-	grlib_apbuart_configure();
+	ret = grlib_apbuart_configure();
+	if (ret)
+		return ret;
 
 	printk(KERN_INFO "Serial: GRLIB APBUART driver\n");
 

  parent reply	other threads:[~2011-07-24  7:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23 22:44 OLPC power management patches - merge for 3.1? Daniel Drake
2011-07-24  3:20 ` Randy Dunlap
2011-07-24  8:59   ` Daniel Drake
2011-07-24 17:13     ` Randy Dunlap
2011-07-24 17:16       ` Daniel Drake
2011-07-24 17:33         ` Randy Dunlap
2011-07-24 17:23       ` Andres Salomon
2011-07-24  7:27 ` Ingo Molnar [this message]
2011-07-24  8:55   ` Daniel Drake
2011-07-24 10:18     ` Ingo Molnar

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=20110724072729.GA21281@elte.hu \
    --to=mingo@elte.hu \
    --cc=dilinger@queued.net \
    --cc=dsd@laptop.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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