[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <164183932244.16921.9315200768989413599.tip-bot2@tip-bot2>
Date: Mon, 10 Jan 2022 18:28:42 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...e.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: irq/msi] genirq/msi: Populate sysfs entry only once
The following commit has been merged into the irq/msi branch of tip:
Commit-ID: 74a5257a0c175810d620b5e631c4e7554955ac25
Gitweb: https://git.kernel.org/tip/74a5257a0c175810d620b5e631c4e7554955ac25
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 10 Jan 2022 19:12:45 +01:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Mon, 10 Jan 2022 19:22:10 +01:00
genirq/msi: Populate sysfs entry only once
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@...en8.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Borislav Petkov <bp@...e.de>
Link: https://lore.kernel.org/r/87leznqx2a.ffs@tglx
---
kernel/irq/msi.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 173bc04..2bdfce5 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -887,12 +887,11 @@ int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
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++;
}
Powered by blists - more mailing lists