svn commit: r298425 - head/sys/dev/acpica

John Baldwin jhb at FreeBSD.org
Thu Apr 21 18:27:06 UTC 2016


Author: jhb
Date: Thu Apr 21 18:27:05 2016
New Revision: 298425
URL: https://svnweb.freebsd.org/changeset/base/298425

Log:
  Queue the CPU-probing task after all acpi_cpu devices are attached.
  
  Eventually with earlier AP startup this code will change to call the
  startup function synchronously instead of queueing the task.  Moving
  the time we queue the task should be a no-op since taskqueue threads
  don't start executing tasks until much later, but this reduces the diff
  with the earlier AP startup patches.
  
  Sponsored by:	Netflix

Modified:
  head/sys/dev/acpica/acpi_cpu.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- head/sys/dev/acpica/acpi_cpu.c	Thu Apr 21 17:45:37 2016	(r298424)
+++ head/sys/dev/acpica/acpi_cpu.c	Thu Apr 21 18:27:05 2016	(r298425)
@@ -355,9 +355,6 @@ acpi_cpu_attach(device_t dev)
 	cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx,
 	    SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu",
 	    CTLFLAG_RD, 0, "node for CPU children");
-
-	/* Queue post cpu-probing task handler */
-	AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL);
     }
 
     /*
@@ -423,17 +420,27 @@ acpi_cpu_postattach(void *unused __unuse
     device_t *devices;
     int err;
     int i, n;
+    int attached;
 
     err = devclass_get_devices(acpi_cpu_devclass, &devices, &n);
     if (err != 0) {
 	printf("devclass_get_devices(acpi_cpu_devclass) failed\n");
 	return;
     }
+    attached = 0;
+    for (i = 0; i < n; i++)
+	if (device_is_attached(devices[i]))
+	    attached = 1;
     for (i = 0; i < n; i++)
 	bus_generic_probe(devices[i]);
     for (i = 0; i < n; i++)
 	bus_generic_attach(devices[i]);
     free(devices, M_TEMP);
+
+    if (attached) {
+	/* Queue post cpu-probing task handler */
+	AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL);
+    }
 }
 
 SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE,


More information about the svn-src-head mailing list