[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171019211651.039346004D@linux.fjfi.cvut.cz>
Date: Thu, 19 Oct 2017 22:57:02 +0200
From: David Kozub <zub@...ux.fjfi.cvut.cz>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] clockevents/drivers/cs5535: improve resilience to spurious
interrupts
This solves a BUG on ALIX 2c3 where mfgpt_tick is called before
clockevents_config_and_register returns. This caused mfgpt_tick to call a
null function pointer.
Thanks to Daniel Lezcano and Thomas Gleixner for helping me analyze this
and suggesting a solution.
Suggested-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: David Kozub <zub@...ux.fjfi.cvut.cz>
---
drivers/clocksource/cs5535-clockevt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c
index a1df588343f2..56100506b933 100644
--- a/drivers/clocksource/cs5535-clockevt.c
+++ b/drivers/clocksource/cs5535-clockevt.c
@@ -117,7 +117,8 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
/* Turn off the clock (and clear the event) */
disable_timer(cs5535_event_clock);
- if (clockevent_state_shutdown(&cs5535_clockevent))
+ if (clockevent_state_detached(&cs5535_clockevent) ||
+ clockevent_state_shutdown(&cs5535_clockevent))
return IRQ_HANDLED;
/* Clear the counter */
--
2.14.2
Powered by blists - more mailing lists