[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] genirq/msi: Populate sysfs entry only once
- To: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>
- From: Cédric Le Goater <clg@xxxxxxxx>
- Date: Tue, 11 Jan 2022 10:02:01 +0100
- Authentication-results: garm.ovh; auth=pass (GARM-95G001713f3599-f95f-45bc-8458-3cc8394211bc, 5383433EA887FCAE918FFCB03530F9AACAE8953B) smtp.auth=clg@xxxxxxxx
- Cc: Bjorn Helgaas <helgaas@xxxxxxxxxx>, Marc Zygnier <maz@xxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxxxx>, Megha Dey <megha.dey@xxxxxxxxx>, Ashok Raj <ashok.raj@xxxxxxxxx>, <linux-pci@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Niklas Schnelle <schnelle@xxxxxxxxxxxxx>, <linux-s390@xxxxxxxxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, Logan Gunthorpe <logang@xxxxxxxxxxxx>, Jon Mason <jdmason@xxxxxxxx>, Dave Jiang <dave.jiang@xxxxxxxxx>, Allen Hubbe <allenbh@xxxxxxxxx>, <linux-ntb@xxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 11 Jan 2022 09:02:19 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Reviewed-by: Cédric Le Goater <clg@xxxxxxxx>
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++;
}
|