From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 7.mo552.mail-out.ovh.net (7.mo552.mail-out.ovh.net. [188.165.59.253]) by gmr-mx.google.com with ESMTPS id e13si473474wrg.0.2022.01.11.01.02.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 01:02:12 -0800 (PST) Message-ID: <83cac5d2-b5f2-836c-1f4f-bfe054a8bedb@kaod.org> Date: Tue, 11 Jan 2022 10:02:01 +0100 MIME-Version: 1.0 Subject: Re: [patch] genirq/msi: Populate sysfs entry only once Content-Language: en-US References: <20211206210600.123171746@linutronix.de> <20211206210749.224917330@linutronix.de> <87leznqx2a.ffs@tglx> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <87leznqx2a.ffs@tglx> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit To: Thomas Gleixner , LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Juergen Gross , Greg Kroah-Hartman , Niklas Schnelle , linux-s390@vger.kernel.org, Heiko Carstens , Christian Borntraeger , Logan Gunthorpe , Jon Mason , Dave Jiang , Allen Hubbe , linux-ntb@googlegroups.com List-ID: 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 > Signed-off-by: Thomas Gleixner Reviewed-by: Cédric Le Goater 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++; > } >