From patchwork Sat Feb 26 10:04:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kjetil Oftedal X-Patchwork-Id: 84640 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 0687EB70B3 for ; Sat, 26 Feb 2011 21:04:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777Ab1BZKEa (ORCPT ); Sat, 26 Feb 2011 05:04:30 -0500 Received: from mail44.e.nsc.no ([193.213.115.44]:65014 "EHLO mail44.e.nsc.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757Ab1BZKEa (ORCPT ); Sat, 26 Feb 2011 05:04:30 -0500 Received: from 87.103.189.109.customer.cdi.no (87.103.189.109.customer.cdi.no [109.189.103.87]) by mail44.nsc.no (8.14.4/8.14.4) with ESMTP id p1QA4NU3029647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 26 Feb 2011 11:04:24 +0100 (MET) Date: Sat, 26 Feb 2011 11:04:23 +0100 (CET) From: Kjetil Oftedal X-X-Sender: kjetil@oizys.tordivel.org To: David Miller cc: sparclinux@vger.kernel.org Subject: Re: [PATCH v3] Fix multiple RTC detections on SUN4D In-Reply-To: <20110225.181611.189702682.davem@davemloft.net> Message-ID: References: <20110225.181611.189702682.davem@davemloft.net> MIME-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On Fri, 25 Feb 2011, David Miller wrote: > From: Kjetil Oftedal > Date: Sun, 17 Oct 2010 06:38:57 +0200 (CEST) > > > Fix the date on your computer, today is not Oct 17th 2010. > Whoops. Resubmitting with the correct date in the e-mail header: During the preparation for testing the recent changes made to the SUN4D specific code in the kernel by Sam Ravnborg the following was discovered: Since the removal of of_platform_bus_type (commit: eca3930163ba8884060ce9d9ff5ef0d9b7c7b00f ) multiboard SUN4Ds have not been able to boot. The kernel crashes due to a zero-pointer error encountered when registering multiple M48T59 RTCs (There is one on each board). A patch for the was previously submitted, but the problem was not a serious at that time, as it would only generate warnings. Now the kernel will crash and stop executing before the serial console has been started. (Crash output can be viewed by using the -p boot flag) Signed-off-by: Kjetil Oftedal --- arch/sparc/kernel/time_32.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 9c743b1..ec8476d 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -150,6 +150,10 @@ static int __devinit clock_probe(struct platform_device *op, const struct of_dev if (!model) return -ENODEV; + /* Only the primary RTC has an address property */ + if (!of_find_property(dp, "address", NULL)) + return -ENODEV; + m48t59_rtc.resource = &op->resource[0]; if (!strcmp(model, "mk48t02")) { /* Map the clock register io area read-only */