Commit 68581e93 authored by Mark Nelson's avatar Mark Nelson Committed by Benjamin Herrenschmidt

powerpc/pseries: Add WARN_ON() to request_event_sources_irqs() on irq allocation/request failure

At the moment if request_event_sources_irqs() can't allocate or request
the interrupt, it just does a KERN_ERR printk. This may be fine for the
existing RAS code where if we miss an EPOW event it just means that the
event won't be logged and if we miss one of the RAS errors then we could
miss an event that we perhaps should take action on.

But, for the upcoming IO events code that will use event-sources if we
can't allocate or request the interrupt it means we'd potentially miss
an interrupt from the device. So, let's add a WARN_ON() in this error
case so that we're a bit more vocal when something's amiss.

While we're at it, also use pr_err() to neaten the code up a bit.
Signed-off-by: default avatarMark Nelson <markn@au1.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent b08e281b
...@@ -41,9 +41,12 @@ void request_event_sources_irqs(struct device_node *np, ...@@ -41,9 +41,12 @@ void request_event_sources_irqs(struct device_node *np,
if (count > 15) if (count > 15)
break; break;
virqs[count] = irq_create_mapping(NULL, *(opicprop++)); virqs[count] = irq_create_mapping(NULL, *(opicprop++));
if (virqs[count] == NO_IRQ) if (virqs[count] == NO_IRQ) {
printk(KERN_ERR "Unable to allocate interrupt " pr_err("event-sources: Unable to allocate "
"number for %s\n", np->full_name); "interrupt number for %s\n",
np->full_name);
WARN_ON(1);
}
else else
count++; count++;
...@@ -59,9 +62,12 @@ void request_event_sources_irqs(struct device_node *np, ...@@ -59,9 +62,12 @@ void request_event_sources_irqs(struct device_node *np,
virqs[count] = irq_create_of_mapping(oirq.controller, virqs[count] = irq_create_of_mapping(oirq.controller,
oirq.specifier, oirq.specifier,
oirq.size); oirq.size);
if (virqs[count] == NO_IRQ) if (virqs[count] == NO_IRQ) {
printk(KERN_ERR "Unable to allocate interrupt " pr_err("event-sources: Unable to allocate "
"number for %s\n", np->full_name); "interrupt number for %s\n",
np->full_name);
WARN_ON(1);
}
else else
count++; count++;
} }
...@@ -70,8 +76,9 @@ void request_event_sources_irqs(struct device_node *np, ...@@ -70,8 +76,9 @@ void request_event_sources_irqs(struct device_node *np,
/* Now request them */ /* Now request them */
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (request_irq(virqs[i], handler, 0, name, NULL)) { if (request_irq(virqs[i], handler, 0, name, NULL)) {
printk(KERN_ERR "Unable to request interrupt %d for " pr_err("event-sources: Unable to request interrupt "
"%s\n", virqs[i], np->full_name); "%d for %s\n", virqs[i], np->full_name);
WARN_ON(1);
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment