From patchwork Thu Apr 7 00:06:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 8767641 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5AA609F372 for ; Thu, 7 Apr 2016 00:09:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78FAC201E4 for ; Thu, 7 Apr 2016 00:09:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0263201CD for ; Thu, 7 Apr 2016 00:09:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anxTU-0002g8-VG; Thu, 07 Apr 2016 00:07:04 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anxTT-0002fb-Tx for xen-devel@lists.xensource.com; Thu, 07 Apr 2016 00:07:04 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id CE/78-12342-7A4A5075; Thu, 07 Apr 2016 00:07:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsVybKJsh+6yJaz hBk/XK1vcm/Ke3YHRY3vfLvYAxijWzLyk/IoE1oxJZ3ayFnzgrZjSM5etgfE9dxcjF4eQwFRG iSuNkxm7GDmBnBlMEl+fyHQxcnCwCehK3LwtARIWEUiQuPv0GzNIPbPANyaJ3aefMYMkhAXCJ da297CB2CwCqhLnl2xhArF5BRwk5s08DVYjISAn0fJjNyuIzSngKLH81FRWiF0OEo1LlzBC1G RIzOuZwwphe0ksunEJylaTuHpuE/MERr4FjAyrGNWLU4vKUot0LfWSijLTM0pyEzNzdA0NTPV yU4uLE9NTcxKTivWS83M3MQKDhAEIdjCubXU+xCjJwaQkyutayRouxJeUn1KZkVicEV9UmpNa fIhRhoNDSYK3bzFQTrAoNT21Ii0zBxiuMGkJDh4lEd4VIGne4oLE3OLMdIjUKUZFKXHeiSAJA ZBERmkeXBssRi4xykoJ8zICHSLEU5BalJtZgir/ilGcg1FJmHcpyBSezLwSuOmvgBYzAS2uF2 YCWVySiJCSamCMmrZpUePiKDPDctFzR4W+z956t10le0+YkcoETquD5Sr97IrsslMN3168LxF 7aOJLk7Ybeufuf8xcEq64Ou999q+b7HqTJ2mfU95l6NL70/OC3ycOPVbJ3oz2jRVs79pClJnl X7x2OPHG/Nc5d5XwHmnW4Ldyf106d+zYGJu9kb9W+dCKmFQlluKMREMt5qLiRABhhlEAjAIAA A== X-Env-Sender: mcgrof@kernel.org X-Msg-Ref: server-6.tower-206.messagelabs.com!1459987621!33072502!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40239 invoked from network); 7 Apr 2016 00:07:02 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Apr 2016 00:07:02 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 389D62020F; Thu, 7 Apr 2016 00:07:00 +0000 (UTC) Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA3522025A; Thu, 7 Apr 2016 00:06:58 +0000 (UTC) From: "Luis R. Rodriguez" To: bp@alien8.de, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, rusty@rustcorp.com.au Date: Wed, 6 Apr 2016 17:06:25 -0700 Message-Id: <1459987594-5434-6-git-send-email-mcgrof@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1459987594-5434-1-git-send-email-mcgrof@kernel.org> References: <1459987594-5434-1-git-send-email-mcgrof@kernel.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xensource.com, matt@codeblueprint.co.uk, andrew.cooper3@citrix.com, x86@kernel.org, linux-kernel@vger.kernel.org, luto@amacapital.net, jlee@suse.com, "Luis R. Rodriguez" , lguest@lists.ozlabs.org, glin@suse.com, david.vrabel@citrix.com, boris.ostrovsky@oracle.com, andriy.shevchenko@linux.intel.com Subject: [Xen-devel] [PATCH v4 05/14] x86, ACPI: move ACPI_FADT_NO_CMOS_RTC check to ACPI boot code X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This moves the ACPI specific check into the ACPI boot code, it also takes advantage of the x86_platform.legacy.rtc which is checked for already on the RTC initialization code. This lets us remove the nasty #ifdefery and consolidate the checks to use only one toggle to disable the RTC init code. The works as RTC is initialized by device_initcall(add_rtc_cmos), this will run late in boot on start_kernel() during rest_init(), acpi_parse_fadt() gets called earlier during setup_arch(). Signed-off-by: Luis R. Rodriguez --- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/rtc.c | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 1db7e80c26f2..5e736e2108a1 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -911,6 +911,10 @@ late_initcall(hpet_insert_resource); static int __init acpi_parse_fadt(struct acpi_table_header *table) { + if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) { + pr_debug("ACPI: not registering RTC platform device\n"); + x86_platform.legacy.rtc = 0; + } #ifdef CONFIG_X86_PM_TIMER /* detect the location of the ACPI PM Timer */ diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 62c48da3889d..ff4f4180fefd 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c @@ -189,14 +189,6 @@ static __init int add_rtc_cmos(void) if (of_have_populated_dt()) return 0; -#ifdef CONFIG_ACPI - if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) { - /* This warning can likely go away again in a year or two. */ - pr_info("ACPI: not registering RTC platform device\n"); - return -ENODEV; - } -#endif - if (!x86_platform.legacy.rtc) return -ENODEV;