Module Name:    src
Committed By:   jmcneill
Date:           Sun Oct 21 11:56:26 UTC 2018

Modified Files:
        src/sys/arch/arm/acpi: acpi_pci_machdep.c

Log Message:
Do not add PCI link references until the bus has been mapped


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/acpi_pci_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.3 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.4
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.3	Sun Oct 21 00:42:05 2018
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Sun Oct 21 11:56:26 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.3 2018/10/21 00:42:05 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.4 2018/10/21 11:56:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.3 2018/10/21 00:42:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.4 2018/10/21 11:56:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -187,13 +187,6 @@ acpi_pci_md_attach_hook(device_t parent,
 			handle = ad->ad_handle;
 	}
 
-	if (ad != NULL) {
-		/*
-		 * This is a new ACPI managed bus. Add PCI link references.
-		 */
-		acpi_pci_md_pci_link(ad->ad_handle, pba->pba_bus);
-	}
-
 	if (handle != NULL) {
 		prt = kmem_alloc(sizeof(*prt), KM_SLEEP);
 		prt->prt_bus = pba->pba_bus;
@@ -202,6 +195,13 @@ acpi_pci_md_attach_hook(device_t parent,
 	}
 
 	acpimcfg_map_bus(self, pba->pba_pc, pba->pba_bus);
+
+	if (ad != NULL) {
+		/*
+		 * This is a new ACPI managed bus. Add PCI link references.
+		 */
+		acpi_pci_md_pci_link(ad->ad_handle, pba->pba_bus);
+	}
 }
 
 static int

Reply via email to