Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe().
authorHasso Tepper <hasso@estpak.ee>
Mon, 4 May 2009 08:43:29 +0000 (11:43 +0300)
committerHasso Tepper <hasso@estpak.ee>
Mon, 4 May 2009 08:50:49 +0000 (11:50 +0300)
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

sys/dev/acpica5/acpi_cpu.c

index 237cd49..c514c5c 100644 (file)
@@ -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;
        }
 
        /*