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: 8183301 Return-Path: X-Original-To: patchwork-kvm@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 CA89ABEEE5 for ; Mon, 1 Feb 2016 20:30:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15045202B8 for ; Mon, 1 Feb 2016 20:30:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42E0B200F0 for ; Mon, 1 Feb 2016 20:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932726AbcBAU3t (ORCPT ); Mon, 1 Feb 2016 15:29:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34763 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932070AbcBAU3q (ORCPT ); Mon, 1 Feb 2016 15:29:46 -0500 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 Cc: linaro-acpi@lists.linaro.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, al.stone@linaro.org, graeme.gregory@linaro.org, davem@davemloft.net, jeffrey.t.kirsher@intel.com, richardcochran@gmail.com, arnd@arndb.de, wim@iguana.be, jcm@redhat.com, leo.duran@amd.com, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Suravee.Suthikulpanit@amd.com, robherring2@gmail.com, Fu Wei 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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;