[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <166869767519.4906.15352965310185673367.tip-bot2@tip-bot2>
Date: Thu, 17 Nov 2022 15:07:55 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jason Gunthorpe <jgg@...dia.com>,
Bjorn Helgaas <bhelgaas@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, maz@...nel.org
Subject: [tip: irq/core] PCI/MSI: Reject MSI-X early
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 99f3d279765725920aa5924fa445537a20129a6f
Gitweb: https://git.kernel.org/tip/99f3d279765725920aa5924fa445537a20129a6f
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Fri, 11 Nov 2022 14:55:11 +01:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 17 Nov 2022 15:15:22 +01:00
PCI/MSI: Reject MSI-X early
Similar to PCI multi-MSI reject MSI-X enablement when a irq domain is
attached to the device which does not support MSI-X.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Link: https://lore.kernel.org/r/20221111122015.631728309@linutronix.de
---
drivers/pci/msi/msi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index bc84647..0740acd 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -762,6 +762,10 @@ int __pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int
if (WARN_ON_ONCE(dev->msix_enabled))
return -EINVAL;
+ /* Check MSI-X early on irq domain enabled architectures */
+ if (!pci_msi_domain_supports(dev, MSI_FLAG_PCI_MSIX, ALLOW_LEGACY))
+ return -ENOTSUPP;
+
if (!pci_msi_supported(dev, nvec) || dev->current_state != PCI_D0)
return -EINVAL;
Powered by blists - more mailing lists