diff options
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 14 | ||||
-rw-r--r-- | kernel/irq/irqdomain.c | 20 |
2 files changed, 28 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index d30e6a676c89..ee21b5e71aec 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1001,8 +1001,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, | |||
1001 | 1001 | ||
1002 | if (hw == mpic->spurious_vec) | 1002 | if (hw == mpic->spurious_vec) |
1003 | return -EINVAL; | 1003 | return -EINVAL; |
1004 | if (mpic->protected && test_bit(hw, mpic->protected)) | 1004 | if (mpic->protected && test_bit(hw, mpic->protected)) { |
1005 | return -EINVAL; | 1005 | pr_warning("mpic: Mapping of source 0x%x failed, " |
1006 | "source protected by firmware !\n",\ | ||
1007 | (unsigned int)hw); | ||
1008 | return -EPERM; | ||
1009 | } | ||
1006 | 1010 | ||
1007 | #ifdef CONFIG_SMP | 1011 | #ifdef CONFIG_SMP |
1008 | else if (hw >= mpic->ipi_vecs[0]) { | 1012 | else if (hw >= mpic->ipi_vecs[0]) { |
@@ -1029,8 +1033,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, | |||
1029 | if (mpic_map_error_int(mpic, virq, hw)) | 1033 | if (mpic_map_error_int(mpic, virq, hw)) |
1030 | return 0; | 1034 | return 0; |
1031 | 1035 | ||
1032 | if (hw >= mpic->num_sources) | 1036 | if (hw >= mpic->num_sources) { |
1037 | pr_warning("mpic: Mapping of source 0x%x failed, " | ||
1038 | "source out of range !\n",\ | ||
1039 | (unsigned int)hw); | ||
1033 | return -EINVAL; | 1040 | return -EINVAL; |
1041 | } | ||
1034 | 1042 | ||
1035 | mpic_msi_reserve_hwirq(mpic, hw); | 1043 | mpic_msi_reserve_hwirq(mpic, hw); |
1036 | 1044 | ||
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 96f3a1d9c379..5a83dde8ca0c 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -462,9 +462,23 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, | |||
462 | if (domain->ops->map) { | 462 | if (domain->ops->map) { |
463 | ret = domain->ops->map(domain, virq, hwirq); | 463 | ret = domain->ops->map(domain, virq, hwirq); |
464 | if (ret != 0) { | 464 | if (ret != 0) { |
465 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | 465 | /* |
466 | virq, hwirq, ret); | 466 | * If map() returns -EPERM, this interrupt is protected |
467 | WARN_ON(1); | 467 | * by the firmware or some other service and shall not |
468 | * be mapped. | ||
469 | * | ||
470 | * Since on some platforms we blindly try to map everything | ||
471 | * we end up with a log full of backtraces. | ||
472 | * | ||
473 | * So instead, we silently fail on -EPERM, it is the | ||
474 | * responsibility of the PIC driver to display a relevant | ||
475 | * message if needed. | ||
476 | */ | ||
477 | if (ret != -EPERM) { | ||
478 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | ||
479 | virq, hwirq, ret); | ||
480 | WARN_ON(1); | ||
481 | } | ||
468 | irq_data->domain = NULL; | 482 | irq_data->domain = NULL; |
469 | irq_data->hwirq = 0; | 483 | irq_data->hwirq = 0; |
470 | goto err_unmap; | 484 | goto err_unmap; |