Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1883280ybv; Fri, 21 Feb 2020 05:07:34 -0800 (PST) X-Google-Smtp-Source: APXvYqyZP6Y6VfYHe9KFIY/D0kkPvB6bRzNlDrDjB2LcC3XTGGtK4ngNlBc6GK1rPFVHJcK67cpO X-Received: by 2002:aca:c4d2:: with SMTP id u201mr1974588oif.54.1582290454413; Fri, 21 Feb 2020 05:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582290454; cv=none; d=google.com; s=arc-20160816; b=FoyZbZ/Ni9r5FnCTtt+U/dcHc3btjkqypRfbHk1noyg33jUe6f/wAyLjW/KP5gA+gq lkOKyBL5oBWlI3qDZDPPsBKB7Nsi4Jx80I6p8p91faPQbMPt5uVv5YeAf2LJhlZgXy8k vtdff7nFVzAcFpCsNDyU/Xsd/DxC+T/qk6OtYMcMO+/9IW0PXXPI8xyIhteOw41RM2s5 +1BZBrap9RcxKkd1eR5U5KC/AZ0cNyuGxsv5WYyQZQhVxGZQInRwot2/lg56NRanM8by HZ7sDGsYJQax9E7WP9onQbh6r9VkU8UrUuyDL/fVD2jnX1RVxUcAiN0DPz/MwZNyWYZP en9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GvvYwhtnMEEM1ZLIJcg6BerxDC9iOdAHQD4nTDeNIvQ=; b=kdY/8LN5/vr8jOITMYIsjx8ghnIehO0RyzuPz9nnHtF2D+Gg8LLjBGBgEheuROzPSW fg1FPMDXaOPY5nJLWs22GOV27uHV7nq4MIx59vBF7VX9CmaOmxueaUrhsK+KzBlcqYHO saeyyvJsux/c5Yi3Y4S0Lym3aa+GkkvZ+CsTGQLnlOY8UiVQBm1Xow4OsLtawMpx+q7J DiHvw+U2chJQ717x8QPoQDaCEbpBh+/dCyzU0ZcV/8BnCDmZVWRK4R+DEK7CCQ9hhXKR axz2/WdQXxl0ZcOgVOfdClfaXISZI7C3u6UMiGTAxo4Zz4I6UptZLtdE4WiE9/m6Gth/ h1mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si1374008oth.175.2020.02.21.05.07.14; Fri, 21 Feb 2020 05:07:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbgBUNEy (ORCPT + 99 others); Fri, 21 Feb 2020 08:04:54 -0500 Received: from foss.arm.com ([217.140.110.172]:38838 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728330AbgBUNEx (ORCPT ); Fri, 21 Feb 2020 08:04:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8903530E; Fri, 21 Feb 2020 05:04:53 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 388F73F703; Fri, 21 Feb 2020 05:04:52 -0800 (PST) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, linux@armlinux.org.uk, tglx@linutronix.de, luto@kernel.org, m.szyprowski@samsung.com, vincenzo.frascino@arm.com Subject: [PATCH] clocksource: Fix arm_arch_timer clockmode when vDSO disabled Date: Fri, 21 Feb 2020 13:03:55 +0000 Message-Id: <20200221130355.21373-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The arm_arch_timer requires that VDSO_CLOCKMODE_ARCHTIMER to be defined to compile correctly. On arm the vDSO can be disabled and when this is the case the compilation ends prematurely with an error: $ make ARCH=arm multi_v7_defconfig $ ./scripts/config -d VDSO $ make drivers/clocksource/arm_arch_timer.c:73:44: error: ‘VDSO_CLOCKMODE_ARCHTIMER’ undeclared here (not in a function) static enum vdso_clock_mode vdso_default = VDSO_CLOCKMODE_ARCHTIMER; ^ scripts/Makefile.build:267: recipe for target 'drivers/clocksource/arm_arch_timer.o' failed make[2]: *** [drivers/clocksource/arm_arch_timer.o] Error 1 make[2]: *** Waiting for unfinished jobs.... scripts/Makefile.build:505: recipe for target 'drivers/clocksource' failed make[1]: *** [drivers/clocksource] Error 2 make[1]: *** Waiting for unfinished jobs.... Makefile:1683: recipe for target 'drivers' failed make: *** [drivers] Error 2 Define VDSO_CLOCKMODE_ARCHTIMER as VDSO_CLOCKMODE_NONE when the vDSOs are not enabled to address the issue. Fixes: 5e3c6a312a09 ("ARM/arm64: vdso: Use common vdso clock mode storage") Cc: Russell King Cc: Thomas Gleixner Reported-by: Marek Szyprowski Signed-off-by: Vincenzo Frascino --- drivers/clocksource/arm_arch_timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index ee2420d56f67..619839221f94 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -49,6 +49,11 @@ #define CNTV_TVAL 0x38 #define CNTV_CTL 0x3c +#ifndef CONFIG_GENERIC_GETTIMEOFDAY +/* The define below is required because on arm the VDSOs can be disabled */ +#define VDSO_CLOCKMODE_ARCHTIMER VDSO_CLOCKMODE_NONE +#endif /* CONFIG_GENERIC_GETTIMEOFDAY */ + static unsigned arch_timers_present __initdata; static void __iomem *arch_counter_base; -- 2.25.0