svn commit: r347929 - head/sys/dev/pci

Emmanuel Vadot manu at FreeBSD.org
Fri May 17 17:04:02 UTC 2019


Author: manu
Date: Fri May 17 17:04:01 2019
New Revision: 347929
URL: https://svnweb.freebsd.org/changeset/base/347929

Log:
  pci: ecam: Do not warn on mismatch of bus_end
  
  We cannot know the bus end number before parsing the MCFG table
  so don't set the bus_end before that. If the MCFG table doesn't
  exist we will set the configuration base address based on the _CBA
  value and set the bus_end to the maximal number allowed by PCI.
  
  Sponsored by: Ampere Computing, LLC
  
  Differential Revision:	https://reviews.freebsd.org/D20213

Modified:
  head/sys/dev/pci/pci_host_generic_acpi.c

Modified: head/sys/dev/pci/pci_host_generic_acpi.c
==============================================================================
--- head/sys/dev/pci/pci_host_generic_acpi.c	Fri May 17 16:41:18 2019	(r347928)
+++ head/sys/dev/pci/pci_host_generic_acpi.c	Fri May 17 17:04:01 2019	(r347929)
@@ -207,11 +207,7 @@ pci_host_acpi_get_ecam_resource(device_t dev)
 				mcfg_entry++;
 		}
 		if (found) {
-			if (mcfg_entry->EndBusNumber < sc->base.bus_end) {
-				device_printf(dev, "bus end mismatch! expected %d found %d.\n",
-				    sc->base.bus_end, (int)mcfg_entry->EndBusNumber);
-				sc->base.bus_end = mcfg_entry->EndBusNumber;
-			}
+			sc->base.bus_end = mcfg_entry->EndBusNumber;
 			base = mcfg_entry->Address;
 		} else {
 			device_printf(dev, "MCFG exists, but does not have bus %d-%d\n",
@@ -220,9 +216,10 @@ pci_host_acpi_get_ecam_resource(device_t dev)
 		}
 	} else {
 		status = acpi_GetInteger(handle, "_CBA", &val);
-		if (ACPI_SUCCESS(status))
+		if (ACPI_SUCCESS(status)) {
 			base = val;
-		else
+			sc->base.bus_end = 255;
+		} else
 			return (ENXIO);
 	}
 
@@ -259,7 +256,6 @@ pci_host_generic_acpi_attach(device_t dev)
 		device_printf(dev, "No _BBN, using start bus 0\n");
 		sc->base.bus_start = 0;
 	}
-	sc->base.bus_end = 255;
 
 	/* Get PCI Segment (domain) needed for MCFG lookup */
 	status = acpi_GetInteger(handle, "_SEG", &sc->base.ecam);


More information about the svn-src-all mailing list