Skip to content

Commit b930742

Browse files
mszyprowDaniel Lezcano
authored andcommitted
clocksource/drivers/exynos_mct: Fix error path in timer resources initialization
While freeing interrupt handlers in error path, don't assume that all requested interrupts are per-processor interrupts and properly release standard interrupts too. Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Fixes: 56a94f1 ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 9fd464f commit b930742

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎drivers/clocksource/exynos_mct.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,19 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem *
562562
return 0;
563563

564564
out_irq:
565-
free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick);
565+
if (mct_int_type == MCT_INT_PPI) {
566+
free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick);
567+
} else {
568+
for_each_possible_cpu(cpu) {
569+
struct mct_clock_event_device *pcpu_mevt =
570+
per_cpu_ptr(&percpu_mct_tick, cpu);
571+
572+
if (pcpu_mevt->evt.irq != -1) {
573+
free_irq(pcpu_mevt->evt.irq, pcpu_mevt);
574+
pcpu_mevt->evt.irq = -1;
575+
}
576+
}
577+
}
566578
return err;
567579
}
568580

0 commit comments

Comments
 (0)