Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-08-03 Thread Boris Brezillon
On Mon, 3 Aug 2015 16:36:29 +0200 (CEST) Thomas Gleixner wrote: > On Mon, 3 Aug 2015, Boris Brezillon wrote: > > On Sun, 2 Aug 2015 11:40:28 +0200 > > Peter Zijlstra wrote: > > > > > On Sun, Aug 02, 2015 at 11:10:21AM +0200, Thomas Gleixner wrote: > > > > I think Boris Brezillon had implemented

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-08-03 Thread Thomas Gleixner
On Mon, 3 Aug 2015, Boris Brezillon wrote: > On Sun, 2 Aug 2015 11:40:28 +0200 > Peter Zijlstra wrote: > > > On Sun, Aug 02, 2015 at 11:10:21AM +0200, Thomas Gleixner wrote: > > > I think Boris Brezillon had implemented it at some point, but it was > > > shot down for reasons I can't remember. >

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-08-03 Thread Boris Brezillon
Peter, Thomas, On Sun, 2 Aug 2015 11:40:28 +0200 Peter Zijlstra wrote: > On Sun, Aug 02, 2015 at 11:10:21AM +0200, Thomas Gleixner wrote: > > I think Boris Brezillon had implemented it at some point, but it was > > shot down for reasons I can't remember. > > You weren't around at the time.. DT

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-08-02 Thread Peter Zijlstra
On Sun, Aug 02, 2015 at 11:10:21AM +0200, Thomas Gleixner wrote: > I think Boris Brezillon had implemented it at some point, but it was > shot down for reasons I can't remember. You weren't around at the time.. DT people didn't like it, said they didn't like having to make up fake hardware in the

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-08-02 Thread Thomas Gleixner
On Mon, 20 Jul 2015, Thomas Gleixner wrote: > On Mon, 20 Jul 2015, Alexandre Belloni wrote: > > > On 20/07/2015 at 11:04:30 +0200, Thomas Gleixner wrote : > > > That's why I used setup/remove_irq() in the stale RT changes. > > > > > > > Hum, actually, you hit the same thing with setup/remove_ir

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-20 Thread Thomas Gleixner
On Mon, 20 Jul 2015, Alexandre Belloni wrote: > On 20/07/2015 at 11:04:30 +0200, Thomas Gleixner wrote : > > That's why I used setup/remove_irq() in the stale RT changes. > > > > Hum, actually, you hit the same thing with setup/remove_irq (and I'm not sure > to follow why): It's the kmalloc of

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-20 Thread Alexandre Belloni
On 20/07/2015 at 11:04:30 +0200, Thomas Gleixner wrote : > That's why I used setup/remove_irq() in the stale RT changes. > Hum, actually, you hit the same thing with setup/remove_irq (and I'm not sure to follow why): BUG: sleeping function called from invalid context at mm/slab.c:2863 in_atomic(

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-20 Thread Thomas Gleixner
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(d

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-18 Thread Alexandre Belloni
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)) > > + re

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-18 Thread Thomas Gleixner
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_inter

[PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

2015-07-17 Thread Alexandre Belloni
Setup and remove the interrupt handler in clock event mode selection. This avoids calling the (shared) interrupt handler when the device is not used. Signed-off-by: Alexandre Belloni --- drivers/clocksource/timer-atmel-st.c | 43 +--- 1 file changed, 35 insertions