Skip to content

Commit

Permalink
sh: intc: Handle domain association for sparseirq pre-allocated vectors.
Browse files Browse the repository at this point in the history
Presently it's assumed that the irqdomain code handles the irq_desc
allocation for us, but this isn't necessarily the case when we've
pre-allocated IRQs via sparseirq. Previously we had a -EEXIST check in
the code that attempted to trap these cases and simply update them
in-place, but this behaviour was inadvertently lost in the transition to
irqdomains.

This simply restores the previous behaviour, first attempting to let the
irqdomain core fetch the allocation for us, and falling back to an
in-place domain association in the extant IRQ case. Fixes up regressions
on platforms that pre-allocate legacy IRQs (specifically ARM-based
SH-Mobile platforms, as SH stopped pre-allocating vectors some time ago).

Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
pmundt committed Aug 9, 2012
1 parent 800fb3d commit 1026023
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions drivers/sh/intc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,16 @@ int __init register_intc_controller(struct intc_desc *desc)

res = irq_create_identity_mapping(d->domain, irq);
if (unlikely(res)) {
pr_err("can't get irq_desc for %d\n", irq);
continue;
if (res == -EEXIST) {
res = irq_domain_associate(d->domain, irq, irq);
if (unlikely(res)) {
pr_err("domain association failure\n");
continue;
}
} else {
pr_err("can't identity map IRQ %d\n", irq);
continue;
}
}

intc_irq_xlate_set(irq, vect->enum_id, d);
Expand All @@ -345,8 +353,19 @@ int __init register_intc_controller(struct intc_desc *desc)
*/
res = irq_create_identity_mapping(d->domain, irq2);
if (unlikely(res)) {
pr_err("can't get irq_desc for %d\n", irq2);
continue;
if (res == -EEXIST) {
res = irq_domain_associate(d->domain,
irq, irq);
if (unlikely(res)) {
pr_err("domain association "
"failure\n");
continue;
}
} else {
pr_err("can't identity map IRQ %d\n",
irq);
continue;
}
}

vect2->enum_id = 0;
Expand Down

0 comments on commit 1026023

Please sign in to comment.