Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request

The jcore-aic irqchip does not have separate interrupt numbers reserved for
cpu-local vs global interrupts. Therefore the device drivers need to
request the given interrupt as per CPU interrupt.

69a9dcbd2d65 ("clocksource/drivers/jcore: Use request_percpu_irq()")
converted the clocksource driver over to request_percpu_irq(), but failed
to do add all the required changes, resulting in a failure to register PIT
interrupts.

Fix this by:

1) Explicitly mark the interrupt via irq_set_percpu_devid() in
jcore_pit_init().

2) Enable and disable the per CPU interrupt in the CPU hotplug callbacks.

3) Pass the correct per-cpu cookie to the irq handler by using
handle_percpu_devid_irq() instead of handle_percpu_irq() in
handle_jcore_irq().

[ tglx: Massage change log ]

Fixes: 69a9dcbd2d65 ("clocksource/drivers/jcore: Use request_percpu_irq()")
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/all/20250216175545.35079-3-contact@artur-rojek.eu

authored by

Artur Rojek and committed by
Thomas Gleixner
d7e3fd65 4cb77793

+15 -2
+14 -1
drivers/clocksource/jcore-pit.c
··· 114 114 pit->periodic_delta = DIV_ROUND_CLOSEST(NSEC_PER_SEC, HZ * buspd); 115 115 116 116 clockevents_config_and_register(&pit->ced, freq, 1, ULONG_MAX); 117 + enable_percpu_irq(pit->ced.irq, IRQ_TYPE_NONE); 118 + 119 + return 0; 120 + } 121 + 122 + static int jcore_pit_local_teardown(unsigned cpu) 123 + { 124 + struct jcore_pit *pit = this_cpu_ptr(jcore_pit_percpu); 125 + 126 + pr_info("Local J-Core PIT teardown on cpu %u\n", cpu); 127 + 128 + disable_percpu_irq(pit->ced.irq); 117 129 118 130 return 0; 119 131 } ··· 180 168 return -ENOMEM; 181 169 } 182 170 171 + irq_set_percpu_devid(pit_irq); 183 172 err = request_percpu_irq(pit_irq, jcore_timer_interrupt, 184 173 "jcore_pit", jcore_pit_percpu); 185 174 if (err) { ··· 250 237 251 238 cpuhp_setup_state(CPUHP_AP_JCORE_TIMER_STARTING, 252 239 "clockevents/jcore:starting", 253 - jcore_pit_local_init, NULL); 240 + jcore_pit_local_init, jcore_pit_local_teardown); 254 241 255 242 return 0; 256 243 }
+1 -1
drivers/irqchip/irq-jcore-aic.c
··· 38 38 static void handle_jcore_irq(struct irq_desc *desc) 39 39 { 40 40 if (irqd_is_per_cpu(irq_desc_get_irq_data(desc))) 41 - handle_percpu_irq(desc); 41 + handle_percpu_devid_irq(desc); 42 42 else 43 43 handle_simple_irq(desc); 44 44 }