From: Thomas Gleixner <tglx@linutronix.de>
To: David Kozub <zub@linux.fjfi.cvut.cz>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>, linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Kernel BUG in mfgpt_tick (cs5535-clockevt.c) on ALIX 2c3 - null call
Date: Mon, 16 Oct 2017 11:30:47 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1710161121520.1973@nanos> (raw)
In-Reply-To: <alpine.LRH.2.21.1710122150120.2000@linux.fjfi.cvut.cz>
On Thu, 12 Oct 2017, David Kozub wrote:
> On Thu, 12 Oct 2017, Thomas Gleixner wrote:
> > On Thu, 12 Oct 2017, Daniel Lezcano wrote:
> > The real question is why
> >
> > /* Set the clock scale and enable the event mode for CMP2 */
> > val = MFGPT_SCALE | (3 << 8);
> >
> > cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val);
> >
> > is in the setup code at all.
> >
> > The obvious place for this is in mfgpt_set_periodic() which gets called
> > when the clock event and the handler is set up in the core code. Up to that
> > point the interrupt handler is protected against shared interrupts via the
> > is_shutdown() check.
>
> It is, but only after clockevents_config_and_register. But mfgpt_tick is
> called before that (just after setup_irq).
Right, but the protection against the spurious interrupt there is not
sufficient. See patch below.
Thanks,
tglx
8<-------------------
--- 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 */
next prev parent reply other threads:[~2017-10-16 9:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-07 21:26 David Kozub
2017-10-09 8:39 ` Daniel Lezcano
2017-10-09 19:33 ` David Kozub
2017-10-10 13:03 ` Daniel Lezcano
2017-10-10 21:19 ` David Kozub
2017-10-11 8:26 ` Daniel Lezcano
2017-10-11 20:48 ` David Kozub
2017-10-12 12:47 ` Daniel Lezcano
2017-10-12 15:29 ` Thomas Gleixner
2017-10-12 20:53 ` David Kozub
2017-10-16 9:30 ` Thomas Gleixner [this message]
2017-10-16 20:41 ` David Kozub
2017-10-18 18:23 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1710161121520.1973@nanos \
--to=tglx@linutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zub@linux.fjfi.cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®