From patchwork Fri Apr 24 21:43:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Lynch X-Patchwork-Id: 6273631 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 61BC2BF4A6 for ; Fri, 24 Apr 2015 21:46:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FCF820377 for ; Fri, 24 Apr 2015 21:46:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8033202E5 for ; Fri, 24 Apr 2015 21:46:50 +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 1YllO3-0000Yq-Hz; Fri, 24 Apr 2015 21:43:51 +0000 Received: from relay1.mentorg.com ([192.94.38.131]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YllO1-0000WC-1d for linux-arm-kernel@lists.infradead.org; Fri, 24 Apr 2015 21:43:49 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1YllNd-0007Rh-5r from Nathan_Lynch@mentor.com ; Fri, 24 Apr 2015 14:43:25 -0700 Received: from localhost (147.34.91.1) by SVR-ORW-FEM-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 24 Apr 2015 14:43:24 -0700 From: Nathan Lynch To: Subject: [PATCH 2/2] ARM: VDSO: use arch_timer_okay_for_vdso Date: Fri, 24 Apr 2015 16:43:21 -0500 Message-ID: <1429911801-6069-2-git-send-email-nathan_lynch@mentor.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1429911801-6069-1-git-send-email-nathan_lynch@mentor.com> References: <1429911801-6069-1-git-send-email-nathan_lynch@mentor.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150424_144349_134536_81D97A2C X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Russell King , Marc Zyngier , Catalin Marinas , Daniel Lezcano , Stephen Boyd , Doug Anderson , Will Deacon , linux-kernel@vger.kernel.org, Thomas Gleixner , Sonny Rao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Use the facility now provided by the arm_arch_timer driver to determine whether there's a usable virtual counter for the VDSO. Signed-off-by: Nathan Lynch --- arch/arm/kernel/vdso.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index efe17dd9b921..f06fd6f3f65f 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -69,33 +68,6 @@ struct elfinfo { */ static bool cntvct_ok __read_mostly; -static bool __init cntvct_functional(void) -{ - struct device_node *np; - bool ret = false; - - if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) - goto out; - - /* The arm_arch_timer core should export - * arch_timer_use_virtual or similar so we don't have to do - * this. - */ - np = of_find_compatible_node(NULL, NULL, "arm,armv7-timer"); - if (!np) - goto out_put; - - if (of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) - goto out_put; - - ret = true; - -out_put: - of_node_put(np); -out: - return ret; -} - static void * __init find_section(Elf32_Ehdr *ehdr, const char *name, unsigned long *size) { @@ -208,7 +180,7 @@ static int __init vdso_init(void) vdso_total_pages = 1; /* for the data/vvar page */ vdso_total_pages += text_pages; - cntvct_ok = cntvct_functional(); + cntvct_ok = arch_timer_okay_for_vdso(); patch_vdso(&vdso_start);