aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-05 21:37:43 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-05 21:37:43 -0400
commit5fe0c1f2f0dca3351536284b0180a79f341b7854 (patch)
tree20e7cc0ae006c8e21fb476d27eeed30771262706 /arch/powerpc
parentf3d40c2532fee15a30d7a364ac365c21748a4a95 (diff)
irqdomain: Allow quiet failure mode
Some interrupt controllers refuse to map interrupts marked as "protected" by firwmare. Since we try to map everyting in the device-tree on some platforms, we end up with a lot of nasty WARN's in the boot log for what is a normal situation on those machines. This defines a specific return code (-EPERM) from the host map() callback which cause irqdomain to fail silently. MPIC is updated to return this when hitting a protected source printing only a single line message for diagnostic purposes. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/mpic.c14
1 files changed, 11 insertions, 3 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