Skip to content

Commit

Permalink
avr32: allow system timer to share interrupt to make OProfile work
Browse files Browse the repository at this point in the history
The following patch allows the avr32_comparator interrupt to be shared.
This is necessary as the avr32 oprofile driver shares the irq group 0
with the timer.

To make OProfile actually work on AVR32, a small patch for oprofiled is
also needed (posted to the oprofile mailing list).

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
[haavard.skinnemoen@atmel.com: set IRQF_SHARED unconditionally]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
  • Loading branch information
Voss, Nikolaus authored and Haavard Skinnemoen committed Jul 25, 2008
1 parent db6ea2c commit 56d3eef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/avr32/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
struct clock_event_device *evdev = dev_id;

if (unlikely(!(intc_get_pending(0) & 1)))
return IRQ_NONE;

/*
* Disable the interrupt until the clockevent subsystem
* reprograms it.
Expand All @@ -55,7 +58,8 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)

static struct irqaction timer_irqaction = {
.handler = timer_interrupt,
.flags = IRQF_TIMER | IRQF_DISABLED,
/* Oprofile uses the same irq as the timer, so allow it to be shared */
.flags = IRQF_TIMER | IRQF_DISABLED | IRQF_SHARED,
.name = "avr32_comparator",
};

Expand Down

0 comments on commit 56d3eef

Please sign in to comment.