]> Pileus Git - ~andy/linux/commitdiff
irqdomain: Relax failure path on setting up mappings
authorGrant Likely <grant.likely@linaro.org>
Wed, 29 May 2013 02:10:53 +0000 (03:10 +0100)
committerGrant Likely <grant.likely@linaro.org>
Mon, 10 Jun 2013 10:52:09 +0000 (11:52 +0100)
Commit 98aa468e, "irqdomain: Support for static IRQ mapping and
association" introduced an API for directly associating blocks of hwirqs
to linux irqs. However, if any irq in that block failed to map (say if
the mapping functions returns an error because the irq is already
mapped) then the whole thing will fail and roll back. This is probably
too aggressive since there are valid reasons why a mapping may fail.
ie. Firmware may have a particular IRQ marked as unusable.

This patch drops the error path out of irq_domain_associate(). If a
mapping fails, then it is simply skipped. There is no reason to fail the
entire allocation.

v2: Still output an information message on failed mappings and make sure
    attempted mapping gets cleared out of the irq_data structure.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/irqdomain.c

index 20b677dd0b279c3bd3fd4af1bb2ffc3e761599ea..61d6d3c80feec3aad05dd86dab1a732167e2644c 100644 (file)
@@ -464,23 +464,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
                                /*
                                 * If map() returns -EPERM, this interrupt is protected
                                 * by the firmware or some other service and shall not
-                                * be mapped.
-                                *
-                                * Since on some platforms we blindly try to map everything
-                                * we end up with a log full of backtraces.
-                                *
-                                * So instead, we silently fail on -EPERM, it is the
-                                * responsibility of the PIC driver to display a relevant
-                                * message if needed.
+                                * be mapped. Don't bother telling the user about it.
                                 */
                                if (ret != -EPERM) {
-                                       pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
-                                              virq, hwirq, ret);
-                                       WARN_ON(1);
+                                       pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n",
+                                              of_node_full_name(domain->of_node), hwirq, virq, ret);
                                }
                                irq_data->domain = NULL;
                                irq_data->hwirq = 0;
-                               goto err_unmap;
+                               continue;
                        }
                }