]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
clocksource/drivers/exynos_mct: Fix error path in timer resources initialization
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 18 Oct 2018 09:57:04 +0000 (11:57 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Sat, 23 Feb 2019 11:13:45 +0000 (12:13 +0100)
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: 56a94f13919c ("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>
drivers/clocksource/exynos_mct.c

index 647ea9fc752f6fcfe6f571a0089b47d361069910..33e90c080877b5dc7d3b0700b84c853b231bf4d0 100644 (file)
@@ -562,7 +562,19 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem *
        return 0;
 
 out_irq:
-       free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick);
+       if (mct_int_type == MCT_INT_PPI) {
+               free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick);
+       } else {
+               for_each_possible_cpu(cpu) {
+                       struct mct_clock_event_device *pcpu_mevt =
+                               per_cpu_ptr(&percpu_mct_tick, cpu);
+
+                       if (pcpu_mevt->evt.irq != -1) {
+                               free_irq(pcpu_mevt->evt.irq, pcpu_mevt);
+                               pcpu_mevt->evt.irq = -1;
+                       }
+               }
+       }
        return err;
 }