From patchwork Sun Aug 15 07:26:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 61752 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C244DB6EE9 for ; Mon, 16 Aug 2010 02:20:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932355Ab0HOQUl (ORCPT ); Sun, 15 Aug 2010 12:20:41 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:58888 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932128Ab0HOQUl (ORCPT ); Sun, 15 Aug 2010 12:20:41 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id E7E0024C088; Sun, 15 Aug 2010 00:26:58 -0700 (PDT) Date: Sun, 15 Aug 2010 00:26:58 -0700 (PDT) Message-Id: <20100815.002658.27793549.davem@davemloft.net> To: elendil@planet.nl Cc: sparclinux@vger.kernel.org Subject: Re: Serial console issue with 2.6.32 From: David Miller In-Reply-To: <201006021953.36508.elendil@planet.nl> References: <201003171150.08245.elendil@planet.nl> <20100525.235154.189709335.davem@davemloft.net> <201006021953.36508.elendil@planet.nl> X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Frans Pop Date: Wed, 2 Jun 2010 19:53:34 +0200 > On Wednesday 26 May 2010, David Miller wrote: >> -------------------- >> sunserial: Don't call add_preferred_console() when console= is >> specified. > > Thanks for the patch David. I've tried to test with it, but for some reason > the box does not boot at all with .34 (both with and without the patch) if > I pass console=ttyS0. If I don't pass the parameter it boots fine. Ok, I think I really got it this time :-) Please add this patch on top of the existing stuff. -------------------- sparc: Really fix "console=" for serial consoles. If a video head and keyboard are hooked up, specifying "console=ttyS0" or similar to use a serial console will not work properly. The key issue is that we must register all serial console capable devices with register_console(), otherwise the command line specified device won't be found. The sun serial drivers would only register themselves as console devices if the OpenFirmware specified console device node matched. To fix this part we now unconditionally get the serial console register by setting serial_drv->cons always. Secondarily we must not add_preferred_console() using the firmware provided console setting if the user gaven an override on the kernel command line using "console=" The "primary framebuffer" matching logic was always triggering o n openfirmware device node match, make it not when a command line override was given. Reported-by: Frans Pop Signed-off-by: David S. Miller --- arch/sparc/include/asm/fb.h | 4 ++++ drivers/serial/suncore.c | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h index e834880..2173432 100644 --- a/arch/sparc/include/asm/fb.h +++ b/arch/sparc/include/asm/fb.h @@ -1,5 +1,6 @@ #ifndef _SPARC_FB_H_ #define _SPARC_FB_H_ +#include #include #include #include @@ -18,6 +19,9 @@ static inline int fb_is_primary_device(struct fb_info *info) struct device *dev = info->device; struct device_node *node; + if (console_set_on_cmdline) + return 0; + node = dev->of_node; if (node && node == of_console_device) diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c index 544f2e2..6381a02 100644 --- a/drivers/serial/suncore.c +++ b/drivers/serial/suncore.c @@ -55,7 +55,12 @@ EXPORT_SYMBOL(sunserial_unregister_minors); int sunserial_console_match(struct console *con, struct device_node *dp, struct uart_driver *drv, int line, bool ignore_line) { - if (!con || of_console_device != dp) + if (!con) + return 0; + + drv->cons = con; + + if (of_console_device != dp) return 0; if (!ignore_line) { @@ -69,12 +74,10 @@ int sunserial_console_match(struct console *con, struct device_node *dp, return 0; } - con->index = line; - drv->cons = con; - - if (!console_set_on_cmdline) + if (!console_set_on_cmdline) { + con->index = line; add_preferred_console(con->name, line, NULL); - + } return 1; } EXPORT_SYMBOL(sunserial_console_match);