From c34aa62640ea511eed36401f8fbd3d744931a81f Mon Sep 17 00:00:00 2001 From: ume Date: Thu, 25 Aug 2005 10:50:36 +0000 Subject: initialize only ACPI_BUFFER to avoid race condition with passive cooling thread which refers psv, tc1, tc2 and tsp. The previous code made the period where sc->tz_zone.tsp was zero, and it caused panic at msleep(). Reported by: keramida Tested by: keramida --- sys/dev/acpica/acpi_thermal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index f7b4540..e78a24d 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -347,7 +347,14 @@ acpi_tz_establish(struct acpi_tz_softc *sc) AcpiOsFree(sc->tz_zone.al[i].Pointer); if (sc->tz_zone.psl.Pointer != NULL) AcpiOsFree(sc->tz_zone.psl.Pointer); - bzero(&sc->tz_zone, sizeof(sc->tz_zone)); + + /* + * XXX: We initialize only ACPI_BUFFER to avoid race condition + * with passive cooling thread which refers psv, tc1, tc2 and tsp. + */ + bzero(sc->tz_zone.ac, sizeof(sc->tz_zone.ac)); + bzero(sc->tz_zone.al, sizeof(sc->tz_zone.al)); + bzero(&sc->tz_zone.psl, sizeof(sc->tz_zone.psl)); /* Evaluate thermal zone parameters. */ for (i = 0; i < TZ_NUMLEVELS; i++) { -- cgit v1.1