Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1231883pxf; Fri, 9 Apr 2021 03:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSmqJ2kfRQ0FRThKQyeIsX/+Um0+ViSPRj9yN3VmUfF4G1UgrVmt6Dt7XvXqjyJ3MxDNEC X-Received: by 2002:a17:906:3509:: with SMTP id r9mr6691386eja.490.1617964137904; Fri, 09 Apr 2021 03:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617964137; cv=none; d=google.com; s=arc-20160816; b=YFlUV4DjMBNIKVU+BgIFnmi5Qv6gNNdUhTWUOnpJ+7MLwErGe71AHTNlRRuc/YTJ5N LUK4YTnkke/f94YLzIu1SFyZOYNJE2H5o6G2LrZntgyhd/h6PgOCXjAsppj8l78l3HpI +0SAi+Wuv8vI25sicQMMT6gK/gVsqej0haAv5MDxel8Wqs8ZvMQy/qCZ8HrrkJBJgd6d HD5BHv6kWyvkHWaXYPO5ifw99Ji0B7crrfXfpHcEC0RQBXrC7tlt1Y0STPEnrJf0PANd y3rMSuuIa+guG0/Q32CLK6Uay6u+9vYZPMAn8lwEj9kB4BidZPg6bs5xMNQtUZLLaxlj xcHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=tCBMI1IKIzcIwvzOqR7fpPq9U5wh2sz8yqJL2Ewinmg=; b=BvIoapMsDF695b6RJGE/3dAfJcaj1FyLr2DJj5cv8XCi2FXNJL6g8FpUI7qyjLakIo YsamhVIeOjAoXQ7/JdvJnm+lqncYMTPyZAgQx9N5AWx/8Lj69FWyttbaqabxxjC/p//I N9BoIgN4PBcx0tW7iIcvPZzMz4oVfl6GVvlxExjGcSYjQ6/d5iFVGnb00USS5p79N49O TqfopLRMhocQIiMA+U3HONeh7SqjjXxSacXv3duzsHOgQ8Ykzq0pkjjPAiDbGdn0HruB TKK38HBBw74H7t+UU9DTtZ7WuKV6n79+frEJhv8V3bo8+jV4nrVjVIy3zMU16TFSSTIX KbrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YnU6B3Sb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=lX1d28+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l5si1666141ejq.337.2021.04.09.03.28.33; Fri, 09 Apr 2021 03:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YnU6B3Sb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=lX1d28+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233525AbhDIK1t (ORCPT + 99 others); Fri, 9 Apr 2021 06:27:49 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49546 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231402AbhDIK1j (ORCPT ); Fri, 9 Apr 2021 06:27:39 -0400 Date: Fri, 09 Apr 2021 10:27:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1617964045; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tCBMI1IKIzcIwvzOqR7fpPq9U5wh2sz8yqJL2Ewinmg=; b=YnU6B3Sb3G9FUuYyATDaoiPlFpaOeJ955IQNzpM6emepN5w2s8dxqiFnIYJ62YhoRkOaEF CrUL1S5IZT3hAVSsqPHB9JNLWP0k8Ec5sRXO4eHMCjKcrBkyK+ERp55keV/2ijknn5sRyk 0jUYRLOfnbYECBgvAtrFBrUdh1xrGIGkBuZPE11WgifaiTtEHf9nj66CHjkIqDFqctkqCo XrFLmkfchs5E3Eyq+OE2hld7TFX7jgpVFLruCM9UgM2KlSV74lNMPJveyJbT+y7wW0u8sm gQjocL17LfG6SLV3QausQhCzblT2dKDUg1nbyAIDjITDSMuK0f1neLc9HvnZrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1617964045; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tCBMI1IKIzcIwvzOqR7fpPq9U5wh2sz8yqJL2Ewinmg=; b=lX1d28+ICZ+9AXLLO1gTPKwfTNqAQsvGgYjp77S7Dxl9/HGB4d2SUikAJ0lJN+1XIq0DXE XHB8oDA5NFVOYBBw== From: "tip-bot2 for Jisheng Zhang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/arm_arch_timer: Add __ro_after_init and __init Cc: Jisheng Zhang , Marc Zyngier , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210330140444.4fb2a7cb@xhacker.debian> References: <20210330140444.4fb2a7cb@xhacker.debian> MIME-Version: 1.0 Message-ID: <161796404455.29796.11116484336739405400.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: e2bf384d4329bb478ad003eae1ab644756a42266 Gitweb: https://git.kernel.org/tip/e2bf384d4329bb478ad003eae1ab644756a42266 Author: Jisheng Zhang AuthorDate: Tue, 30 Mar 2021 14:04:44 +08:00 Committer: Daniel Lezcano CommitterDate: Thu, 08 Apr 2021 16:41:19 +02:00 clocksource/drivers/arm_arch_timer: Add __ro_after_init and __init Some functions are not needed after booting, so mark them as __init to move them to the .init section. Some global variables are never modified after init, so can be __ro_after_init. Signed-off-by: Jisheng Zhang Acked-by: Marc Zyngier Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210330140444.4fb2a7cb@xhacker.debian --- drivers/clocksource/arm_arch_timer.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index d017782..1b88596 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -51,7 +51,7 @@ static unsigned arch_timers_present __initdata; -static void __iomem *arch_counter_base; +static void __iomem *arch_counter_base __ro_after_init; struct arch_timer { void __iomem *base; @@ -60,15 +60,16 @@ struct arch_timer { #define to_arch_timer(e) container_of(e, struct arch_timer, evt) -static u32 arch_timer_rate; -static int arch_timer_ppi[ARCH_TIMER_MAX_TIMER_PPI]; +static u32 arch_timer_rate __ro_after_init; +u32 arch_timer_rate1 __ro_after_init; +static int arch_timer_ppi[ARCH_TIMER_MAX_TIMER_PPI] __ro_after_init; static struct clock_event_device __percpu *arch_timer_evt; -static enum arch_timer_ppi_nr arch_timer_uses_ppi = ARCH_TIMER_VIRT_PPI; -static bool arch_timer_c3stop; -static bool arch_timer_mem_use_virtual; -static bool arch_counter_suspend_stop; +static enum arch_timer_ppi_nr arch_timer_uses_ppi __ro_after_init = ARCH_TIMER_VIRT_PPI; +static bool arch_timer_c3stop __ro_after_init; +static bool arch_timer_mem_use_virtual __ro_after_init; +static bool arch_counter_suspend_stop __ro_after_init; #ifdef CONFIG_GENERIC_GETTIMEOFDAY static enum vdso_clock_mode vdso_default = VDSO_CLOCKMODE_ARCHTIMER; #else @@ -76,7 +77,7 @@ static enum vdso_clock_mode vdso_default = VDSO_CLOCKMODE_NONE; #endif /* CONFIG_GENERIC_GETTIMEOFDAY */ static cpumask_t evtstrm_available = CPU_MASK_NONE; -static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); +static bool evtstrm_enable __ro_after_init = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); static int __init early_evtstrm_cfg(char *buf) { @@ -176,7 +177,7 @@ static notrace u64 arch_counter_get_cntvct(void) * to exist on arm64. arm doesn't use this before DT is probed so even * if we don't have the cp15 accessors we won't have a problem. */ -u64 (*arch_timer_read_counter)(void) = arch_counter_get_cntvct; +u64 (*arch_timer_read_counter)(void) __ro_after_init = arch_counter_get_cntvct; EXPORT_SYMBOL_GPL(arch_timer_read_counter); static u64 arch_counter_read(struct clocksource *cs) @@ -925,7 +926,7 @@ static int validate_timer_rate(void) * rate was probed first, and don't verify that others match. If the first node * probed has a clock-frequency property, this overrides the HW register. */ -static void arch_timer_of_configure_rate(u32 rate, struct device_node *np) +static void __init arch_timer_of_configure_rate(u32 rate, struct device_node *np) { /* Who has more than one independent system counter? */ if (arch_timer_rate) @@ -939,7 +940,7 @@ static void arch_timer_of_configure_rate(u32 rate, struct device_node *np) pr_warn("frequency not available\n"); } -static void arch_timer_banner(unsigned type) +static void __init arch_timer_banner(unsigned type) { pr_info("%s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n", type & ARCH_TIMER_TYPE_CP15 ? "cp15" : "",