[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240216190113.20341-1-beanhuo@iokpp.de>
Date: Fri, 16 Feb 2024 20:01:13 +0100
From: Bean Huo <beanhuo@...pp.de>
To: bhelgaas@...gle.com,
schnelle@...ux.ibm.com,
sathyanarayanan.kuppuswamy@...ux.intel.com
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bean Huo <beanhuo@...ron.com>,
stable@...r.kernel.org
Subject: [PATCH v2] PCI: Increase maximum PCIe physical function number to 7 for non-ARI devices
From: Bean Huo <beanhuo@...ron.com>
The PCIe specification allows up to 8 Physical Functions (PFs) per endpoint
when ARI (Alternative Routing-ID Interpretation) is not supported. Previously,
our implementation erroneously limited the maximum number of PFs to 7 for
endpoints without ARI support.
This patch corrects the maximum PF count to adhere to the PCIe specification
by allowing up to 8 PFs on non-ARI endpoints. This change ensures better
compliance with the standard and improves compatibility with devices relying
on this specification.
The necessity for this adjustment was verified by a thorough review of the
"Alternative Routing-ID Interpretation (ARI)" section in the PCIe 3.0 Spec,
which first introduced ARI.
Fixes: c3df83e01a96 ("PCI: Clean up pci_scan_slot()")
Cc: stable@...r.kernel.org
Signed-off-by: Bean Huo <beanhuo@...ron.com>
---
Changelog:
v1--v2:
1. Add Fixes tag
2. Modify commit message
---
drivers/pci/probe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ed6b7f48736a..8c3d0f63bc13 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2630,7 +2630,8 @@ static int next_fn(struct pci_bus *bus, struct pci_dev *dev, int fn)
if (pci_ari_enabled(bus))
return next_ari_fn(bus, dev, fn);
- if (fn >= 7)
+ /* If EP does not support ARI, the maximum number of functions should be 7 */
+ if (fn > 7)
return -ENODEV;
/* only multifunction devices may have more functions */
if (dev && !dev->multifunction)
--
2.34.1
Powered by blists - more mailing lists