From: Marc Zyngier <maz@kernel.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Thomas Gleixner <tglx@kernel.org>,
Ben Horgan <ben.horgan@arm.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: [PATCH v3 4/8] clocksource/drivers/arm_arch_timer: Drop the arch_counter_get_cnt{p,v}ct_stable() accessors
Date: Sun, 2 Aug 2026 17:53:23 +0100 [thread overview]
Message-ID: <20260802165327.385217-5-maz@kernel.org> (raw)
In-Reply-To: <20260802165327.385217-1-maz@kernel.org>
Further simplify the counter accessors by eliminating the *_stable()
ones, which serve little purpose at this stage.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
drivers/clocksource/arm_arch_timer.c | 38 +++++++++-------------------
1 file changed, 12 insertions(+), 26 deletions(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index f645aa562895b..5085e87706f99 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -100,19 +100,12 @@ static noinstr u64 raw_counter_get_cntpct(void)
return __arch_counter_get_cntpct();
}
-static notrace u64 arch_counter_get_cntpct_stable(void)
+static notrace u64 arch_counter_get_cntpct(void)
{
- u64 val;
- preempt_disable_notrace();
- val = __arch_counter_get_cntpct_stable();
- preempt_enable_notrace();
- return val;
-}
-
-static noinstr u64 arch_counter_get_cntpct(void)
-{
- if (arch_counter_broken_accessors())
- return arch_counter_get_cntpct_stable();
+ if (arch_counter_broken_accessors()) {
+ guard(preempt_notrace)();
+ return __arch_counter_get_cntpct_stable();
+ }
return __arch_counter_get_cntpct();
}
@@ -125,19 +118,12 @@ static noinstr u64 raw_counter_get_cntvct(void)
return __arch_counter_get_cntvct();
}
-static notrace u64 arch_counter_get_cntvct_stable(void)
+static notrace u64 arch_counter_get_cntvct(void)
{
- u64 val;
- preempt_disable_notrace();
- val = __arch_counter_get_cntvct_stable();
- preempt_enable_notrace();
- return val;
-}
-
-static noinstr u64 arch_counter_get_cntvct(void)
-{
- if (arch_counter_broken_accessors())
- return arch_counter_get_cntvct_stable();
+ if (arch_counter_broken_accessors()) {
+ guard(preempt_notrace)();
+ return __arch_counter_get_cntvct_stable();
+ }
return __arch_counter_get_cntvct();
}
@@ -342,10 +328,10 @@ void erratum_set_next_event_generic(const int access, unsigned long evt,
ctrl &= ~ARCH_TIMER_CTRL_IT_MASK;
if (access == ARCH_TIMER_PHYS_ACCESS) {
- cval = evt + arch_counter_get_cntpct_stable();
+ cval = evt + arch_counter_get_cntpct();
write_sysreg(cval, cntp_cval_el0);
} else {
- cval = evt + arch_counter_get_cntvct_stable();
+ cval = evt + arch_counter_get_cntvct();
write_sysreg(cval, cntv_cval_el0);
}
--
2.47.3
next prev parent reply other threads:[~2026-08-02 16:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 16:53 [PATCH v3 0/8] arm64: arch_timer: Improve errata handling Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 1/8] clocksource/drivers/arm_arch_timer: Add read_sched_clock_is_arch_counter() predicate Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 2/8] clocksource/drivers/arm_arch_timer: Add a static key indicating the need for a runtime workaround Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 3/8] clocksource/drivers/arm_arch_timer: Convert counter accessors to a static key alternative Marc Zyngier
2026-08-02 16:53 ` Marc Zyngier [this message]
2026-08-02 16:53 ` [PATCH v3 5/8] clocksource/drivers/arm_arch_timer: Turn arch_timer_read_counter into a function Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 6/8] clocksource/drivers/arm_arch_timer: Add command-line control over the counter errata management Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 7/8] clocksource/drivers/arm_arch_timer: Expose a direct accessor for the virtual counter Marc Zyngier
2026-08-02 16:53 ` [PATCH v3 8/8] arm64: Convert __delay_cycles() to arch_timer_read_vcounter() Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260802165327.385217-5-maz@kernel.org \
--to=maz@kernel.org \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=tglx@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.