From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused
Date: Mon, 20 Jul 2015 11:04:30 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1507201103550.18576@nanos> (raw)
In-Reply-To: <20150718222308.GA30489@piout.net>
On Sun, 19 Jul 2015, Alexandre Belloni wrote:
> On 18/07/2015 at 10:12:03 +0200, Thomas Gleixner wrote :
> > On Fri, 17 Jul 2015, Alexandre Belloni wrote:
> > > +static int atmel_st_request_irq(struct clock_event_device *dev)
> > > +{
> > > + int ret;
> > > +
> > > + if (clockevent_state_periodic(dev) || clockevent_state_oneshot(dev))
> > > + return 0;
> > > +
> > > + ret = request_irq(irq, at91rm9200_timer_interrupt,
> > > + IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
> > > + "at91_tick", regmap_st);
> > > + if (ret) {
> > > + pr_alert("Unable to setup IRQ\n");
> > > + return ret;
> > > + }
> > > +
> > > return 0;
> > > }
> > >
> > > static int clkevt32k_set_oneshot(struct clock_event_device *dev)
> > > {
> > > + int ret;
> > > +
> > > clkdev32k_disable_and_flush_irq();
> > >
> > > /*
> > > * ALM for oneshot irqs, set by next_event()
> > > * before 32 seconds have passed.
> > > */
> > > + ret = atmel_st_request_irq(dev);
> >
> > You cannot call request_irq() from interrupt disabled context. It
> > works during early boot because might_sleep() is not active then, but
> > if that happens during normal runtime it wont work.
> >
>
> Indeed, clockevents_switch_state() has to be called with interrupts
> disabled. So I'm not sure anymore how we should go about this change
> (obviously, the same applies to the pit change). Do you have an idea?
That's why I used setup/remove_irq() in the stale RT changes.
Thanks,
tglx
next prev parent reply other threads:[~2015-07-20 9:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 19:33 [PATCH 0/3] clocksource: at91: Remove irq handler when clock event is unused Alexandre Belloni
2015-07-17 19:33 ` [PATCH 1/3] clocksource: atmel-st: " Alexandre Belloni
2015-07-18 8:12 ` Thomas Gleixner
2015-07-18 22:23 ` Alexandre Belloni
2015-07-20 9:04 ` Thomas Gleixner [this message]
2015-07-20 19:37 ` Alexandre Belloni
2015-07-20 20:46 ` Thomas Gleixner
2015-08-02 9:10 ` Thomas Gleixner
2015-08-02 9:40 ` Peter Zijlstra
2015-08-03 13:30 ` Boris Brezillon
2015-08-03 14:36 ` Thomas Gleixner
2015-08-03 20:07 ` Boris Brezillon
2015-07-17 19:33 ` [PATCH 2/3] clocksource: atmel-pit: drop at91sam926x_pit_common_init Alexandre Belloni
2015-07-17 19:33 ` [PATCH 3/3] clocksource: atmel-pit: Remove irq handler when clock event is unused Alexandre Belloni
2015-07-18 8:20 ` Thomas Gleixner
2015-07-18 22:18 ` Alexandre Belloni
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.11.1507201103550.18576@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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