Re: Recent CURRENT/i386 + acpi_thermal panic

From: Hajimu UMEMOTO <ume_at_freebsd.org>
Date: Thu, 25 Aug 2005 04:05:12 +0900
Hi,

>>>>> On Wed, 24 Aug 2005 19:30:54 +0300
>>>>> Giorgos Keramidas <keramida_at_freebsd.org> said:

keramida> Recent CURRENT/i386 panics randomly at boot time at (manual copy of the
keramida> console output, so there may be some errors in the numbers copied):

keramida> msleep(c1a761d4,0,54,c0986ce0,0) at msleep+0x6e
keramida> acpi_tz_cooling_thread(c1a76100,d5248d38,c1a76100,c09770bc,0 at acpi_tz_cooling_thread+0x58

Umm, the fifth argument to msleep() is zero.  It means sc->tz_zone.tsp
is zero.  But, it is tested not to zero before invoking
acpi_tz_cooling_thread().  Perhaps, it is cleared some where later.

keramida> Any ideas why this happens "most of the time", every time I boot?

Does this patch work for you for workaround?  It changes to use an
initial value of sc->tz_zone.tsp, and don't use updated value.

Index: acpi_thermal.c
diff -u -p acpi_thermal.c.orig acpi_thermal.c
--- acpi_thermal.c.orig	Thu Aug 18 02:01:25 2005
+++ acpi_thermal.c	Thu Aug 25 03:41:53 2005
_at__at_ -117,6 +117,7 _at__at_ struct acpi_tz_softc {
     int				tz_cooling_active;
     int				tz_cooling_updated;
     int				tz_cooling_saved_freq;
+    int				tz_cooling_tsp;
 };
 
 #define CPUFREQ_MAX_LEVELS	64 /* XXX cpufreq should export this */
_at__at_ -282,6 +283,8 _at__at_ acpi_tz_attach(device_t dev)
 		      OID_AUTO, "_ACx", CTLFLAG_RD, &sc->tz_zone.ac,
 		      sizeof(sc->tz_zone.ac), "IK", "");
 
+    sc->tz_cooling_tsp = sc->tz_zone.tsp;
+
     /*
      * Create thread to service all of the thermal zones.  Register
      * our power profile event handler.
_at__at_ -299,7 +302,7 _at__at_ acpi_tz_attach(device_t dev)
 
     /* Create a thread to handle passive cooling for each zone if enabled. */
     if (sc->tz_cooling_enabled) {
-	if (acpi_tz_cooling_is_available(sc)) {
+	if (acpi_tz_cooling_is_available(sc) && sc->tz_cooling_tsp > 0) {
 	    error = acpi_tz_cooling_thread_start(sc);
 	    if (error != 0) {
 		sc->tz_cooling_enabled = FALSE;
_at__at_ -665,7 +668,7 _at__at_ acpi_tz_cooling_sysctl(SYSCTL_HANDLER_AR
 	return (EINVAL);
 
     if (enabled) {
-	if (acpi_tz_cooling_is_available(sc))
+	if (acpi_tz_cooling_is_available(sc) && sc->tz_cooling_tsp > 0)
 	    error = acpi_tz_cooling_thread_start(sc);
 	else
 	    error = ENODEV;
_at__at_ -1003,7 +1006,7 _at__at_ acpi_tz_cooling_thread(void *arg)
 	}
 	temperature = sc->tz_temperature;
 	tsleep(&sc->tz_cooling_proc, PZERO, "cooling",
-	    hz * sc->tz_zone.tsp / 10);
+	    hz * sc->tz_cooling_tsp / 10);
     }
     if (sc->tz_cooling_active) {
 	acpi_tz_cpufreq_restore(sc);


Sincerely,

--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Wed Aug 24 2005 - 17:05:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:42 UTC