Skip to content

Commit

Permalink
ARC: IRQ: Use hwirq instead of virq in mask/unmask
Browse files Browse the repository at this point in the history
It is necessary to use hwirq instead of virq when you communicate
with an interrupt controller since there is no guaranty that virq
numbers match hwirq numbers.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
kolerov authored and vineetgarc committed Jan 5, 2017
1 parent fa84d73 commit 2163266
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions arch/arc/kernel/intc-arcv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ void arc_init_IRQ(void)

static void arcv2_irq_mask(struct irq_data *data)
{
write_aux_reg(AUX_IRQ_SELECT, data->irq);
write_aux_reg(AUX_IRQ_SELECT, data->hwirq);
write_aux_reg(AUX_IRQ_ENABLE, 0);
}

static void arcv2_irq_unmask(struct irq_data *data)
{
write_aux_reg(AUX_IRQ_SELECT, data->irq);
write_aux_reg(AUX_IRQ_SELECT, data->hwirq);
write_aux_reg(AUX_IRQ_ENABLE, 1);
}

void arcv2_irq_enable(struct irq_data *data)
{
/* set default priority */
write_aux_reg(AUX_IRQ_SELECT, data->irq);
write_aux_reg(AUX_IRQ_SELECT, data->hwirq);
write_aux_reg(AUX_IRQ_PRIORITY, ARCV2_IRQ_DEF_PRIO);

/*
Expand Down
4 changes: 2 additions & 2 deletions arch/arc/kernel/intc-compact.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void arc_irq_mask(struct irq_data *data)
unsigned int ienb;

ienb = read_aux_reg(AUX_IENABLE);
ienb &= ~(1 << data->irq);
ienb &= ~(1 << data->hwirq);
write_aux_reg(AUX_IENABLE, ienb);
}

Expand All @@ -66,7 +66,7 @@ static void arc_irq_unmask(struct irq_data *data)
unsigned int ienb;

ienb = read_aux_reg(AUX_IENABLE);
ienb |= (1 << data->irq);
ienb |= (1 << data->hwirq);
write_aux_reg(AUX_IENABLE, ienb);
}

Expand Down

0 comments on commit 2163266

Please sign in to comment.