Skip to content

Commit

Permalink
ARC: SMP resurrect foss-for-synopsys-dwc-arc-processors#20: clockeven…
Browse files Browse the repository at this point in the history
…t to use request_irq() [not setup_irq]

Since called by all CPUs, the statically allocated struct irqaction
registration was wrong (link list looping)

Also slab is already init by now so we can freely use request_irq()

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
vineetgarc committed Jul 26, 2012
1 parent faf04d6 commit d754b06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion arch/arc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void __init arc_init_IRQ(void)
* Late Interrupt system init called from start_kernel for Boot CPU only
*
* Since slab must already be initialized, platforms can start doing any
* needed setup_irq( )s
* needed request_irq( )s
*/
void __init init_IRQ(void)
{
Expand Down
18 changes: 8 additions & 10 deletions arch/arc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ static DEFINE_PER_CPU(struct clock_event_device, arc_clockevent_device) = {
.set_mode = arc_clkevent_set_mode,
};

static irqreturn_t timer_irq_handler(int irq, void *dev_id);

static struct irqaction arc_timer_irq = {
.name = "Timer0 (clock-evt-dev)",
.flags = IRQF_TIMER | IRQF_DISABLED,
.handler = timer_irq_handler,
.dev_id = &arc_clockevent_device,
};

irqreturn_t timer_irq_handler(int irq, void *dev_id)
{
unsigned int cpu = smp_processor_id();
Expand All @@ -177,6 +168,7 @@ irqreturn_t timer_irq_handler(int irq, void *dev_id)

void __cpuinit arc_clockevent_init(void)
{
int rc;
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(arc_clockevent_device, cpu);

Expand All @@ -187,7 +179,13 @@ void __cpuinit arc_clockevent_init(void)

clockevents_register_device(evt);

setup_irq(TIMER0_INT, &arc_timer_irq);
rc = request_irq(TIMER0_INT, timer_irq_handler,
IRQF_TIMER | IRQF_DISABLED | IRQF_PERCPU,
"Timer0 (clock-evt-dev)", evt);

if (rc)
pr_err("#$*@#$ Timer0: can't register IRQ on cpu%d\n", cpu);

}

void __init time_init(void)
Expand Down

0 comments on commit d754b06

Please sign in to comment.