Date: Thu, 21 Apr 2016 18:27:05 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298425 - head/sys/dev/acpica Message-ID: <201604211827.u3LIR5ML089177@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604211827.u3LIR5ML089177>