From: Hasso Tepper Date: Mon, 4 May 2009 08:43:29 +0000 (+0300) Subject: Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe(). X-Git-Tag: v2.3.1~12 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9a9b8f25f3d9cba03eef5fb64a0df336a796167e Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe(). Put it into acpi_cpu_startup() which is where all the other code to update this global variable lives. This fixes a bug where cpu_cx_count was not updated correctly if acpi_cpu_generic_cx_probe() returned early. Obtained-from: FreeBSD --- diff --git a/sys/dev/acpica5/acpi_cpu.c b/sys/dev/acpica5/acpi_cpu.c index 237cd49956..c514c5c0c1 100644 --- a/sys/dev/acpica5/acpi_cpu.c +++ b/sys/dev/acpica5/acpi_cpu.c @@ -620,10 +620,6 @@ acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc) sc->cpu_cx_count++; } } - - /* Update the largest cx_count seen so far */ - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } /* @@ -763,6 +759,8 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); + if (sc->cpu_cx_count > cpu_cx_count) + cpu_cx_count = sc->cpu_cx_count; } /*