From patchwork Fri Sep 4 18:29:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kjetil Oftedal X-Patchwork-Id: 33012 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5D4BCB7B94 for ; Sat, 5 Sep 2009 05:01:21 +1000 (EST) Received: by ozlabs.org (Postfix) id 4FF44DDD0B; Sat, 5 Sep 2009 05:01:21 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id D625ADDD01 for ; Sat, 5 Sep 2009 05:01:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757168AbZIDTBP (ORCPT ); Fri, 4 Sep 2009 15:01:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757187AbZIDTBP (ORCPT ); Fri, 4 Sep 2009 15:01:15 -0400 Received: from lutt.itea.ntnu.no ([129.241.18.234]:42452 "EHLO lutt.itea.ntnu.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757168AbZIDTBO (ORCPT ); Fri, 4 Sep 2009 15:01:14 -0400 X-Greylist: delayed 541 seconds by postgrey-1.27 at vger.kernel.org; Fri, 04 Sep 2009 15:01:14 EDT Received: from bene1.itea.ntnu.no (bene1.itea.ntnu.no [IPv6:2001:700:300:3::56]) by lutt.itea.ntnu.no (Postfix) with ESMTP id 46F4F23C6C9 for ; Fri, 4 Sep 2009 20:52:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by bene1.itea.ntnu.no (Postfix) with ESMTP id 60B0E16C874; Fri, 4 Sep 2009 20:51:29 +0200 (CEST) Received: from m166j.studby.ntnu.no (m166j.studby.ntnu.no [129.241.137.166]) by bene1.itea.ntnu.no (Postfix) with ESMTP id 1DE2016C7B2; Fri, 4 Sep 2009 20:51:27 +0200 (CEST) Date: Fri, 4 Sep 2009 20:29:31 +0200 (CEST) From: Kjetil Oftedal X-X-Sender: kjetil@oizys.tordivel.org To: David Miller cc: sparclinux@vger.kernel.org Subject: Re: [PATCH v2] Fix multiple RTC detections on SUN4D In-Reply-To: <20090721.230734.193718423.davem@davemloft.net> Message-ID: References: <20090721.230734.193718423.davem@davemloft.net> MIME-Version: 1.0 X-Virus-Scanned: Debian amavisd-new at bene1.itea.ntnu.no Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org Sorry about the slow response. Had some memory issues with the testbox. On SUN4D machines there is one RTC-chip located on each systemboard, when booting all of these will be probed. Registering a second RTC with the kernel fails, and breaks the rtc: [ 0.212000] kobject (f02625f0): tried to init an initialized object, somethi [ 0.212000] [f0141418 : platform_device_register+0x4/0x18 ] [f01edbc4 : cloc [ 0.216000] ------------[ cut here ]------------ [ 0.216000] WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0x84/0xa4() [ 0.216000] sysfs: cannot create duplicate filename '/devices/platform/rtc-m [ 0.216000] Modules linked in: [ 0.216000] [f00c1988 : sysfs_add_one+0x84/0xa4 ] [f00c1f70 : create_dir+0x4 [ 0.216000] ---[ end trace 139ce121c98e96c9 ]--- [ 0.220000] kobject_add_internal failed for rtc-m48t59.0 with -EEXIST, don't [ 0.220000] [f013d568 : device_add+0xc8/0x610 ] [f014134c : platform_device_ [ 0.220000] Registering RTC device failed Later on in the boot the following happens: [ 23.116000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0) The suggested fix searches the supplied RTC node for a address property which only one RTC per system appears to have and registers only this RTC with the kernel. (Tested on SS20/SUN4M and SS1000E/SUN4D). Signed-off-by: Kjetil Oftedal --- 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 614ac7b..a70da0a 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -156,6 +156,10 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id 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 */