lkml.org 
[lkml]   [2022]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch] genirq/msi: Populate sysfs entry only once
From
On 1/10/22 19:12, Thomas Gleixner wrote:
> The MSI entries for multi-MSI are populated en bloc for the MSI descriptor,
> but the current code invokes the population inside the per interrupt loop
> which triggers a warning in the sysfs code and causes the interrupt
> allocation to fail.
>
> Move it outside of the loop so it works correctly for single and multi-MSI.
>
> Fixes: bf5e758f02fc ("genirq/msi: Simplify sysfs handling")
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

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

Thanks,

C.

> ---
> kernel/irq/msi.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> --- a/kernel/irq/msi.c
> +++ b/kernel/irq/msi.c
> @@ -887,12 +887,11 @@ int __msi_domain_alloc_irqs(struct irq_d
> ret = msi_init_virq(domain, virq + i, vflags);
> if (ret)
> return ret;
> -
> - if (info->flags & MSI_FLAG_DEV_SYSFS) {
> - ret = msi_sysfs_populate_desc(dev, desc);
> - if (ret)
> - return ret;
> - }
> + }
> + if (info->flags & MSI_FLAG_DEV_SYSFS) {
> + ret = msi_sysfs_populate_desc(dev, desc);
> + if (ret)
> + return ret;
> }
> allocated++;
> }
>

\
 
 \ /
  Last update: 2022-01-11 10:02    [W:0.208 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site