[PATCH v2 6/9] clocksource/drivers/timer-goldfish: Set clockevent cpumask and irq

Kuan-Wei Chiu visitorckw at gmail.com
Thu Nov 26 10:10:58 PST 2026


Leaving timerdrv->ced.cpumask uninitialized triggers a warning in
clockevents_register_device() when num_possible_cpus() > 1. Once
.cpumask is set to cpu_possible_mask, leaving .irq zero-initialized
causes tick_check_percpu() and tick_setup_device() to operate on IRQ 0
instead of the timer IRQ on SMP systems.

Initialize .cpumask to cpu_possible_mask and .irq to irq.

Fixes: c92e7ef16400 ("clocksource/drivers: Add a goldfish-timer clocksource")
Signed-off-by: Kuan-Wei Chiu <visitorckw at gmail.com>
---
 drivers/clocksource/timer-goldfish.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/timer-goldfish.c b/drivers/clocksource/timer-goldfish.c
index bac84e0f9b7b..93a92a823f8c 100644
--- a/drivers/clocksource/timer-goldfish.c
+++ b/drivers/clocksource/timer-goldfish.c
@@ -117,6 +117,8 @@ int __init goldfish_timer_init(int irq, void __iomem *base)
 	timerdrv->ced = (struct clock_event_device){
 		.name			= "goldfish_timer",
 		.features		= CLOCK_EVT_FEAT_ONESHOT,
+		.cpumask		= cpu_possible_mask,
+		.irq			= irq,
 		.set_state_shutdown	= goldfish_timer_shutdown,
 		.set_state_oneshot      = goldfish_timer_set_oneshot,
 		.set_next_event		= goldfish_timer_next_event,
-- 
2.56.1.839.g22a8290db9-goog




More information about the linux-riscv mailing list