summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-03-26 21:10:35 +0000
committerjhb <jhb@FreeBSD.org>2009-03-26 21:10:35 +0000
commitf369da4f050bfbe89a642027018e42f36f5191d7 (patch)
treeeafb8a4bed4d5871a74865c17d08856b3b0f6351
parentc42156f938d085099332d87c24ee01eeb718e501 (diff)
downloadFreeBSD-src-f369da4f050bfbe89a642027018e42f36f5191d7.zip
FreeBSD-src-f369da4f050bfbe89a642027018e42f36f5191d7.tar.gz
Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and
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. PR: kern/108581 Debugged by: Bruce Cran Reviewed by: avg, njl, sepotvin MFC after: 3 days
-rw-r--r--sys/dev/acpica/acpi_cpu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 2de059a..5044c4a 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -609,10 +609,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;
}
/*
@@ -752,6 +748,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;
}
/*
OpenPOWER on IntegriCloud