diff mbox series

interrupts: Declare xive2 DT node as an interrupt-controller

Message ID 20211020102826.40205-1-fbarrat@linux.ibm.com
State Accepted
Headers show
Series interrupts: Declare xive2 DT node as an interrupt-controller | expand

Commit Message

Frederic Barrat Oct. 20, 2021, 10:28 a.m. UTC
This patch fixes errors seen when linux looks for the interrupt to use
for a device LSI:

     pci X:Y:Z of_irq_parse_pci: failed with rc=-22

The of/irq parsing code requires those new properties to be able to
map the interrupt specifier correctly. It was not needed before
comitting cd12ea6d8e1 ("interrupts: Do not advertise XICS support on
P10"), because the LSI mapping code was defaulting to the XICS
interrupt controller node, which is now removed (and had those
properties).

Fixes: cd12ea6d8e1 ("interrupts: Do not advertise XICS support on P10")
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
---
 hw/xive2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Cédric Le Goater Oct. 20, 2021, 11:02 a.m. UTC | #1
On 10/20/21 12:28, Frederic Barrat wrote:
> This patch fixes errors seen when linux looks for the interrupt to use
> for a device LSI:
> 
>       pci X:Y:Z of_irq_parse_pci: failed with rc=-22
> 
> The of/irq parsing code requires those new properties to be able to
> map the interrupt specifier correctly. It was not needed before
> comitting cd12ea6d8e1 ("interrupts: Do not advertise XICS support on
> P10"), because the LSI mapping code was defaulting to the XICS
> interrupt controller node, which is now removed (and had those
> properties).

Thanks for digging that up.
  
> Fixes: cd12ea6d8e1 ("interrupts: Do not advertise XICS support on P10")
> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>

I would prefer the title to have a "xive/p10:" prefix but anyhow :

Reviewed-by: Cédric Le Goater <clg@kaod.org>


> ---
>   hw/xive2.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xive2.c b/hw/xive2.c
> index 0254175a..30293cdf 100644
> --- a/hw/xive2.c
> +++ b/hw/xive2.c
> @@ -1955,7 +1955,12 @@ static void xive_create_mmio_dt_node(struct xive *x)
>   			     tb + 3 * stride, stride);
>   
>   	dt_add_property_strings(xive_dt_node, "compatible",
> -				"ibm,opal-xive-pe", "ibm,opal-intc");
> +				"ibm,opal-xive-pe", "ibm,opal-xive-vc",
> +				"ibm,opal-intc");
> +
> +	dt_add_property(xive_dt_node, "interrupt-controller", NULL, 0);
> +	dt_add_property_cells(xive_dt_node, "#address-cells", 0);
> +	dt_add_property_cells(xive_dt_node, "#interrupt-cells", 2);
>   
>   	dt_add_property_cells(xive_dt_node, "ibm,xive-eq-sizes",
>   			      12, 16, 21, 24);
> 


As a follow up, it would be nice to fix the XICS interrupt controller
which is declared as a "ibm,opal-xive-vc" on P9 and P8.

This looks like a lets-make-linux-happy hack. See add_ics_node().

Thanks,

C.
Vasant Hegde Oct. 21, 2021, 3:52 a.m. UTC | #2
On 10/20/21 4:32 PM, Cédric Le Goater wrote:
> On 10/20/21 12:28, Frederic Barrat wrote:
>> This patch fixes errors seen when linux looks for the interrupt to use
>> for a device LSI:
>>
>>       pci X:Y:Z of_irq_parse_pci: failed with rc=-22
>>
>> The of/irq parsing code requires those new properties to be able to
>> map the interrupt specifier correctly. It was not needed before
>> comitting cd12ea6d8e1 ("interrupts: Do not advertise XICS support on
>> P10"), because the LSI mapping code was defaulting to the XICS
>> interrupt controller node, which is now removed (and had those
>> properties).
> 
> Thanks for digging that up.
> 
>> Fixes: cd12ea6d8e1 ("interrupts: Do not advertise XICS support on P10")
>> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
> 
> I would prefer the title to have a "xive/p10:" prefix but anyhow :
> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks! Merged to master as d93ddbd39b.

-Vasant
diff mbox series

Patch

diff --git a/hw/xive2.c b/hw/xive2.c
index 0254175a..30293cdf 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1955,7 +1955,12 @@  static void xive_create_mmio_dt_node(struct xive *x)
 			     tb + 3 * stride, stride);
 
 	dt_add_property_strings(xive_dt_node, "compatible",
-				"ibm,opal-xive-pe", "ibm,opal-intc");
+				"ibm,opal-xive-pe", "ibm,opal-xive-vc",
+				"ibm,opal-intc");
+
+	dt_add_property(xive_dt_node, "interrupt-controller", NULL, 0);
+	dt_add_property_cells(xive_dt_node, "#address-cells", 0);
+	dt_add_property_cells(xive_dt_node, "#interrupt-cells", 2);
 
 	dt_add_property_cells(xive_dt_node, "ibm,xive-eq-sizes",
 			      12, 16, 21, 24);