From patchwork Mon Feb 1 20:26:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fu.wei@linaro.org X-Patchwork-Id: 8183481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 13B52BEEE5 for ; Mon, 1 Feb 2016 20:37:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 565B82039C for ; Mon, 1 Feb 2016 20:37:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90C36202B8 for ; Mon, 1 Feb 2016 20:37:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQLBY-0004WP-Ay; Mon, 01 Feb 2016 20:34:56 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQL6s-0007Fx-NJ for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2016 20:30:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id A43B7C0C2344; Mon, 1 Feb 2016 20:29:45 +0000 (UTC) Received: from magi-f22.redhat.com (vpn1-6-221.pek2.redhat.com [10.72.6.221]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11KR5X7003082; Mon, 1 Feb 2016 15:29:23 -0500 From: fu.wei@linaro.org To: rjw@rjwysocki.net, lenb@kernel.org, daniel.lezcano@linaro.org, tglx@linutronix.de, christoffer.dall@linaro.org, marc.zyngier@arm.com, gleb@kernel.org, pbonzini@redhat.com, hanjun.guo@linaro.org, wei@redhat.com, a.spyridakis@virtualopensystems.com Subject: [PATCH v3 6/6] kvm: arm64: Add ACPI support for virt arch timer Date: Tue, 2 Feb 2016 04:26:58 +0800 Message-Id: <1454358418-5157-7-git-send-email-fu.wei@linaro.org> In-Reply-To: <1454358418-5157-1-git-send-email-fu.wei@linaro.org> References: <1454358418-5157-1-git-send-email-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160201_123007_333575_4129D751 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.3 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, leo.duran@amd.com, Fu Wei , al.stone@linaro.org, kvm@vger.kernel.org, linaro-acpi@lists.linaro.org, jcm@redhat.com, richardcochran@gmail.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, davem@davemloft.net, linux-acpi@vger.kernel.org, wim@iguana.be, arnd@arndb.de, jeffrey.t.kirsher@intel.com, Suravee.Suthikulpanit@amd.com, catalin.marinas@arm.com, graeme.gregory@linaro.org, robherring2@gmail.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 From: Fu Wei This patch adds ACPI/GTDT support for virt arch timer using the API in GTDT driver. Signed-off-by: Fu Wei --- virt/kvm/arm/arch_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 0a279d3..4077347 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -385,6 +385,9 @@ static int kvm_timer_get_ppi(unsigned int *ppi) { struct device_node *np; int ret = -EINVAL; +#ifdef CONFIG_ACPI_GTDT + struct arch_timer_data data; +#endif np = of_find_matching_node(NULL, arch_timer_of_match); if (!np) { @@ -397,6 +400,11 @@ static int kvm_timer_get_ppi(unsigned int *ppi) of_node_put(np); skip_of: +#ifdef CONFIG_ACPI_GTDT + if (!*ppi && !gtdt_arch_timer_data_init(NULL, &data)) + *ppi = data.virt_ppi; +#endif + if (*ppi) return 0;