On 2026-03-02 01:39:48 Mon, Nam Cao wrote:
> The per-device MSI allocation calculation in pseries_irq_domain_alloc()
> is clearly wrong. It can still happen to work when nr_irqs is 1.
> 
> Correct it.
> 
> Fixes: c0215e2d72de ("powerpc/pseries: Fix MSI-X allocation failure when 
> quota is exceeded")
> Cc: [email protected]
> Signed-off-by: Nam Cao <[email protected]>
> ---
>  arch/powerpc/platforms/pseries/msi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/msi.c 
> b/arch/powerpc/platforms/pseries/msi.c
> index 64ffc6476ad6..8285b9a29fbf 100644
> --- a/arch/powerpc/platforms/pseries/msi.c
> +++ b/arch/powerpc/platforms/pseries/msi.c
> @@ -605,7 +605,7 @@ static int pseries_irq_domain_alloc(struct irq_domain 
> *domain, unsigned int virq
>                                             &pseries_msi_irq_chip, 
> pseries_dev);
>       }
>  
> -     pseries_dev->msi_used++;
> +     pseries_dev->msi_used += nr_irqs;

Yeah, msi_used was wronlgy incremented only once while allocating
nr_irqs interrupts from parent domain. Looks good to me.

Reviewed-by: Mahesh Salgaonkar <[email protected]>

Thanks,
-Mahesh.

>       return 0;
>  
>  out:
> -- 
> 2.47.3
> 

-- 
Mahesh J Salgaonkar

Reply via email to