All of lore.kernel.org
 help / color / mirror / Atom feed
* [dovetail][PATCH] clocksource/exynos_mct: irq_pipeline: set clockevent IRQs
@ 2026-11-17  5:06 Jan Kiszka
  2026-11-18  9:08 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2026-11-17  5:06 UTC (permalink / raw)
  To: Xenomai, Philippe Gerum

From: Jan Kiszka <jan.kiszka@siemens.com>

The MCT driver only fills clock_event_device::irq for the local timers
in SPI mode. In PPI mode (samsung,exynos4412-mct), the per-CPU tick
devices were left with IRQ 0, so the proxy tick device never switched
the local timer interrupt to out-of-band mode, and the in-band tick ran
on registers which were never saved, making every tick look like a
user mode tick on ARM. The global comparator device had the same
omission.

Assisted-by: opencode:Opus-5.5
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 drivers/clocksource/exynos_mct.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 23d39bf9bdaf9..a548ac338f3bc 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -350,6 +350,7 @@ static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)
 static int exynos4_clockevent_init(void)
 {
 	mct_comp_device.cpumask = cpumask_of(0);
+	mct_comp_device.irq = mct_irqs[MCT_G0_IRQ];
 	clockevents_config_and_register(&mct_comp_device, clk_rate,
 					0xf, 0xffffffff);
 	if (request_irq(mct_irqs[MCT_G0_IRQ], exynos4_mct_comp_isr,
@@ -487,6 +488,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
 		irq_force_affinity(evt->irq, cpumask_of(cpu));
 		enable_irq(evt->irq);
 	} else {
+		evt->irq = mct_irqs[MCT_L0_IRQ];
 		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
 	}
 	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [dovetail][PATCH] clocksource/exynos_mct: irq_pipeline: set clockevent IRQs
  2026-11-17  5:06 [dovetail][PATCH] clocksource/exynos_mct: irq_pipeline: set clockevent IRQs Jan Kiszka
@ 2026-11-18  9:08 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2026-11-18  9:08 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Xenomai

Jan Kiszka <jan.kiszka@siemens.com> writes:

> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The MCT driver only fills clock_event_device::irq for the local timers
> in SPI mode. In PPI mode (samsung,exynos4412-mct), the per-CPU tick
> devices were left with IRQ 0, so the proxy tick device never switched
> the local timer interrupt to out-of-band mode, and the in-band tick ran
> on registers which were never saved, making every tick look like a
> user mode tick on ARM. The global comparator device had the same
> omission.
>
> Assisted-by: opencode:Opus-5.5
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  drivers/clocksource/exynos_mct.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
> index 23d39bf9bdaf9..a548ac338f3bc 100644
> --- a/drivers/clocksource/exynos_mct.c
> +++ b/drivers/clocksource/exynos_mct.c
> @@ -350,6 +350,7 @@ static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)
>  static int exynos4_clockevent_init(void)
>  {
>  	mct_comp_device.cpumask = cpumask_of(0);
> +	mct_comp_device.irq = mct_irqs[MCT_G0_IRQ];
>  	clockevents_config_and_register(&mct_comp_device, clk_rate,
>  					0xf, 0xffffffff);
>  	if (request_irq(mct_irqs[MCT_G0_IRQ], exynos4_mct_comp_isr,
> @@ -487,6 +488,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
>  		irq_force_affinity(evt->irq, cpumask_of(cpu));
>  		enable_irq(evt->irq);
>  	} else {
> +		evt->irq = mct_irqs[MCT_L0_IRQ];
>  		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
>  	}
>  	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),

Merged, thanks.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-18  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17  5:06 [dovetail][PATCH] clocksource/exynos_mct: irq_pipeline: set clockevent IRQs Jan Kiszka
2026-11-18  9:08 ` Philippe Gerum

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.