[PATCH] powerpc/powernv/opal: Use standard interrupts property when available

Michael Ellerman mpe at ellerman.id.au
Wed Aug 1 21:37:00 AEST 2018


Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:

> diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
> index 9d1b8c0aaf93..46785eaf625d 100644
> --- a/arch/powerpc/platforms/powernv/opal-irqchip.c
> +++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
> @@ -216,67 +214,91 @@ int __init opal_event_init(void)
...
>  
>  	/* Install interrupt handlers */
>  	for (i = 0; i < opal_irq_count; i++) {
> -		unsigned int virq;
> -		char *name;
> +		struct resource *r = &opal_irqs[i];
> +		const char *name;
>  
> -		/* Get hardware and virtual IRQ */
> -		virq = irq_create_mapping(NULL, irqs[i]);
> -		if (!virq) {
> -			pr_warn("Failed to map irq 0x%x\n", irqs[i]);
> -			continue;
> -		}
> -
> -		if (names[i] && strlen(names[i]))
> -			name = kasprintf(GFP_KERNEL, "opal-%s", names[i]);
> +		/* Prefix name */
> +		if (r->name)
> +			name = kasprintf(GFP_KERNEL, "opal-%s", r->name);
>  		else
>  			name = kasprintf(GFP_KERNEL, "opal");

I'm getting:

root at p85:/proc/irq# find . -name '*opal*'
...
./63/opal-ipmi
./227/opal-
./228/opal-
./231/opal-
./232/opal-
./247/opal-
./248/opal-
./483/opal-
./484/opal-
./487/opal-
./488/opal-
./500/opal-
./510/opal-
./511/opal-
./512/opal-


I fixed it with:

diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
index 41c3303157f7..a2d067925140 100644
--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
+++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
@@ -275,7 +275,7 @@ int __init opal_event_init(void)
 		const char *name;
 
 		/* Prefix name */
-		if (r->name)
+		if (r->name && strlen(r->name))
 			name = kasprintf(GFP_KERNEL, "opal-%s", r->name);
 		else
 			name = kasprintf(GFP_KERNEL, "opal");


cheers


More information about the Linuxppc-dev mailing list