Skip to contentSkip to conversation

clocksource/arm_arch_timer: flag PPI registration as IRQF_TIMER

PATCH New Andrew MacPherson 1 participant 1 message Sep 7

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource/arm_arch_timer: flag PPI registration as IRQF_TIMER

Dovetail's tick_regs (kernel/irq/pipeline.c) snapshots the register frame of the last timer interrupt for reuse by every deferred in-band IRQ, since the genuinely preempted frame is gone by the time such handlers run. It identifies "the timer" solely via desc->action->flags & __IRQF_TIMER.

arch_timer_register() requests its PPIs with request_percpu_irq(), which always passes flags=0, so this flag can never be set. On any EVL/Dovetail platform using the generic architected timer tick_regs is therefore never populated, and every deferred in-band interrupt handler observes an all-zero pt_regs via get_irq_regs(). Visible symptom: perf record/top report every sample as unresolved (ip == 0), for both hardware and software events.

TWD, ARM Global Timer and Exynos MCT already get this treatment but arch_timer was never converted. Switch its PPI registration to __request_percpu_irq(..., IRQF_TIMER, ...) to match.

Verified on STM32MP157 (Cortex-A7, kernel 6.6.48): before, tick_regs.pc stays zero and perf shows 100% unresolved samples; after, tick_regs refreshes every tick and perf resolves real kernel symbols.

Assisted-by LLM
---
 drivers/clocksource/arm_arch_timer.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/clocksource/arm_arch_timer.c +8 -8
index 0000000000000..0000000000000 100644
@@ -1033,25 +1033,25 @@
 	switch (arch_timer_uses_ppi) {
 	case ARCH_TIMER_VIRT_PPI:
 	case ARCH_TIMER_HYP_VIRT_PPI:
-		err = request_percpu_irq(ppi, arch_timer_handler_virt,
-					 "arch_timer", arch_timer_evt);
+		err = __request_percpu_irq(ppi, arch_timer_handler_virt,
+					 IRQF_TIMER, "arch_timer", arch_timer_evt);
 		break;
 	case ARCH_TIMER_PHYS_SECURE_PPI:
 	case ARCH_TIMER_PHYS_NONSECURE_PPI:
-		err = request_percpu_irq(ppi, arch_timer_handler_phys,
-					 "arch_timer", arch_timer_evt);
+		err = __request_percpu_irq(ppi, arch_timer_handler_phys,
+					 IRQF_TIMER, "arch_timer", arch_timer_evt);
 		if (!err && arch_timer_has_nonsecure_ppi()) {
 			ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI];
-			err = request_percpu_irq(ppi, arch_timer_handler_phys,
-						 "arch_timer", arch_timer_evt);
+			err = __request_percpu_irq(ppi, arch_timer_handler_phys,
+						 IRQF_TIMER, "arch_timer", arch_timer_evt);
 			if (err)
 				free_percpu_irq(arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI],
 						arch_timer_evt);
 		}
 		break;
 	case ARCH_TIMER_HYP_PPI:
-		err = request_percpu_irq(ppi, arch_timer_handler_phys,
-					 "arch_timer", arch_timer_evt);
+		err = __request_percpu_irq(ppi, arch_timer_handler_phys,
+					 IRQF_TIMER, "arch_timer", arch_timer_evt);
 		break;
 	default:
 		BUG();