From patchwork Thu Mar 3 14:10:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 63483 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2973062lbc; Thu, 3 Mar 2016 06:15:34 -0800 (PST) X-Received: by 10.28.35.66 with SMTP id j63mr3835879wmj.78.1457014534065; Thu, 03 Mar 2016 06:15:34 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id yo9si13567947wjc.188.2016.03.03.06.15.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Mar 2016 06:15:34 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abU0w-0005vh-7q; Thu, 03 Mar 2016 14:14:02 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abU0u-0005vY-L5 for xen-devel@lists.xen.org; Thu, 03 Mar 2016 14:14:00 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 62/33-10127-4A648D65; Thu, 03 Mar 2016 14:13:56 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1457014427!26631659!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60385 invoked from network); 3 Mar 2016 14:13:56 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 3 Mar 2016 14:13:56 -0000 Received: from 172.24.1.49 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DCN26530; Thu, 03 Mar 2016 22:13:27 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.235.1; Thu, 3 Mar 2016 22:10:45 +0800 From: Shannon Zhao To: Date: Thu, 3 Mar 2016 22:10:38 +0800 Message-ID: <1457014238-12208-1-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0202.56D84689.0256, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8bf90ec8ec2851c4ebc1582d338a3e46 Cc: stefano.stabellini@citrix.com, JBeulich@suse.com, zhaoshenglong@huawei.com Subject: [Xen-devel] [PATCH] arm/timer: fix panic when booting with DT 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao While to support ACPI, patch "arm/acpi: Parse GTDT to initialize timer" refactors the functions preinit_xen_time and init_xen_time. But it wrongly moves the platform_get_irq from init_xen_time to preinit_dt_xen_time and this will cause booting failure. So move platform_get_irq back to init_xen_time to fix it. Signed-off-by: Shannon Zhao --- xen/arch/arm/time.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c index 5f8f974..66a4520 100644 --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -119,7 +119,6 @@ static void __init preinit_dt_xen_time(void) }; int res; u32 rate; - unsigned int i; timer = dt_find_matching_node(NULL, timer_ids); if ( !timer ) @@ -133,16 +132,6 @@ static void __init preinit_dt_xen_time(void) cpu_khz = rate / 1000; timer_dt_clock_frequency = rate; } - - /* Retrieve all IRQs for the timer */ - for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ ) - { - res = platform_get_irq(timer, i); - - if ( res < 0 ) - panic("Timer: Unable to retrieve IRQ %u from the device tree", i); - timer_irq[i] = res; - } } void __init preinit_xen_time(void) @@ -168,6 +157,22 @@ void __init preinit_xen_time(void) /* Set up the timer on the boot CPU (late init function) */ int __init init_xen_time(void) { + int res; + unsigned int i; + + if ( acpi_disabled ) + { + /* Retrieve all IRQs for the timer */ + for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ ) + { + res = platform_get_irq(timer, i); + + if ( res < 0 ) + panic("Timer: Unable to retrieve IRQ %u from the device tree", i); + timer_irq[i] = res; + } + } + /* Check that this CPU supports the Generic Timer interface */ if ( !cpu_has_gentimer ) panic("CPU does not support the Generic Timer v1 interface");