diff options
author | ume <ume@FreeBSD.org> | 2005-08-25 10:50:36 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-08-25 10:50:36 +0000 |
commit | c34aa62640ea511eed36401f8fbd3d744931a81f (patch) | |
tree | 060ed10de101ac6113d7f0231cde2aea24dd46f4 /sys/dev | |
parent | bd7fc84c8fee1d003ca7bff301927a3477e619ea (diff) | |
download | FreeBSD-src-c34aa62640ea511eed36401f8fbd3d744931a81f.zip FreeBSD-src-c34aa62640ea511eed36401f8fbd3d744931a81f.tar.gz |
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
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpica/acpi_thermal.c | 9 |
1 files changed, 8 insertions, 1 deletions
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++) { |