@@ -258,6 +258,12 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
*/
bar = FIELD_GET(FME_PORT_OFST_BAR_ID, v);
offset = FIELD_GET(FME_PORT_OFST_DFH_OFST, v);
+ if (bar >= FME_HDR_NO_PORT_BAR) {
+ dev_dbg(&pcidev->dev, "skipping port without specific BAR space %d\n",
+ bar);
+ continue;
+ }
+
start = pci_resource_start(pcidev, bar) + offset;
len = pci_resource_len(pcidev, bar) - offset;
@@ -91,6 +91,7 @@
#define FME_HDR_PORT_OFST(n) (0x38 + ((n) * 0x8))
#define FME_HDR_BITSTREAM_ID 0x60
#define FME_HDR_BITSTREAM_MD 0x68
+#define FME_HDR_NO_PORT_BAR 7
/* FME Fab Capability Register Bitfield */
#define FME_CAP_FABRIC_VERID GENMASK_ULL(7, 0) /* Fabric version ID */