mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Marc Zyngier" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: John <therealgraysky@proton.me>,
	Daniel Drake <dan@reactivated.net>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
	Gary Guo <gary@garyguo.net>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/urgent] clocksource/drivers/arm_arch_timer: Workaround bcm2712 broken EL2 virtual timer
Date: Wed, 12 Aug 2026 15:10:59 -0000	[thread overview]
Message-ID: <178654745996.442315.18445733771449352303.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260710080958.491620-1-maz@kernel.org>

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     94f39e4c017e66130e476268bdaa0bf61e914fa2
Gitweb:        https://git.kernel.org/tip/94f39e4c017e66130e476268bdaa0bf61e914fa2
Author:        Marc Zyngier <maz@kernel.org>
AuthorDate:    Fri, 10 Jul 2026 09:09:58 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 12 Aug 2026 17:09:29 +02:00

clocksource/drivers/arm_arch_timer: Workaround bcm2712 broken EL2 virtual timer

It appears that the bcm2712 SoC found in the relatively popular RPi5 has a
broken EL2 virtual timer.

Tthe reason why the timer isn't working is unknown (the timer is ticking,
but the interrupt never fires), and the SoC vendor doesn't communicate on
the reason why this isn't working, leaving users and maintainers in the
dark.

Paper over the issue by detecting the broken HW, falling back to the
physical timer instead, and let the user know about it.  Also taint the
kernel as the machine is definitely not compliant with the spec, and it's
unknown what else is wrong with it.

Reported-by: John <therealgraysky@proton.me>
Reported-by: Daniel Drake <dan@reactivated.net>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Gary Guo <gary@garyguo.net>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260710080958.491620-1-maz@kernel.org
---
 drivers/clocksource/arm_arch_timer.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 4adf756..7b4a98d 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1090,6 +1090,27 @@ static int __init arch_timer_common_init(void)
 	return arch_timer_arch_init();
 }
 
+static bool __init has_broken_el2_vtimer(void)
+{
+	/*
+	 * SoCs described here have been found to be broken, though no
+	 * explanation has been volunteered by the vendor. Let the user know
+	 * we're papering over the vendor's lack of communication.
+	 */
+	static const char * const broken_el2_vtimer[] __initconst = {
+		"brcm,bcm2712",
+		NULL
+	};
+
+	if (of_machine_compatible_match(broken_el2_vtimer)) {
+		add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+		pr_warn_once(HW_ERR "Known broken EL2 virtual timer, ignoring it\n");
+		return true;
+	}
+
+	return false;
+}
+
 /**
  * arch_timer_select_ppi() - Select suitable PPI for the current system.
  *
@@ -1115,7 +1136,8 @@ static int __init arch_timer_common_init(void)
 static enum arch_timer_ppi_nr __init arch_timer_select_ppi(void)
 {
 	if (is_kernel_in_hyp_mode()) {
-		if (arch_timer_ppi[ARCH_TIMER_HYP_VIRT_PPI])
+		if (arch_timer_ppi[ARCH_TIMER_HYP_VIRT_PPI] &&
+		    !has_broken_el2_vtimer())
 			return ARCH_TIMER_HYP_VIRT_PPI;
 
 		pr_warn_once(FW_BUG "VHE-capable CPU without EL2 virtual timer interrupt\n");

      parent reply	other threads:[~2026-08-12 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  8:09 [PATCH] " Marc Zyngier
2026-07-13 16:15 ` Florian Fainelli
2026-07-13 20:23   ` Marc Zyngier
2026-07-13 22:38     ` Florian Fainelli
2026-07-21 19:03 ` Gary Guo
2026-07-22 14:14 ` Jon Hunter
2026-07-22 20:22   ` Marc Zyngier
2026-07-23  9:24     ` Jon Hunter
2026-07-23  9:58       ` Marc Zyngier
2026-07-23 10:22         ` Jon Hunter
2026-07-23 10:46           ` Marc Zyngier
2026-07-27 13:07             ` Jon Hunter
2026-08-12 15:10 ` tip-bot2 for Marc Zyngier [this message]

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=178654745996.442315.18445733771449352303.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=dan@reactivated.net \
    --cc=daniel.lezcano@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maz@kernel.org \
    --cc=tglx@kernel.org \
    --cc=therealgraysky@proton.me \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®