From owner-freebsd-current@FreeBSD.ORG Thu Aug 25 08:12:26 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F5B016A41F; Thu, 25 Aug 2005 08:12:26 +0000 (GMT) (envelope-from ume@mahoroba.org) Received: from ameno.mahoroba.org (gw4.mahoroba.org [218.45.22.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0FDD43D49; Thu, 25 Aug 2005 08:12:22 +0000 (GMT) (envelope-from ume@mahoroba.org) Received: from kasuga.mahoroba.org (IDENT:CUBSFIoGZSi1NLCSiUGtjuHJkgGmeDb2MTwy6paZBvmalTxZaIGzuC/L85s4K0nb@kasuga.mahoroba.org [IPv6:3ffe:501:185b:8010:20b:97ff:fe2e:b521]) (user=ume mech=CRAM-MD5 bits=0) by ameno.mahoroba.org (8.13.3/8.13.3) with ESMTP/inet6 id j7P8Bc3c096657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Aug 2005 17:11:42 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 25 Aug 2005 17:11:35 +0900 Message-ID: From: Hajimu UMEMOTO To: Giorgos Keramidas In-Reply-To: <20050824210954.GA1046@gothmog.gr> References: <20050824163054.GA646@orion.daedalusnetworks.priv> <20050824210954.GA1046@gothmog.gr> User-Agent: xcite1.38> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.0.50 (i386-unknown-freebsd6.0) MULE/5.0 (SAKAKI) X-Operating-System: FreeBSD 6.0-BETA3 X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0 (ameno.mahoroba.org [IPv6:3ffe:501:185b:8010::1]); Thu, 25 Aug 2005 17:11:43 +0900 (JST) X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-Spam-Status: No, score=-5.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on ameno.mahoroba.org Cc: acpi@freebsd.org, freebsd-current@freebsd.org Subject: Re: Recent CURRENT/i386 + acpi_thermal panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2005 08:12:26 -0000 Hi, >>>>> On Thu, 25 Aug 2005 00:09:54 +0300 >>>>> Giorgos Keramidas said: keramida> On 2005-08-25 04:05, Hajimu UMEMOTO wrote: > >>>>> On Wed, 24 Aug 2005 19:30:54 +0300 > >>>>> Giorgos Keramidas 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> The panic message, which I failed to copy was "sleeping without a mutex". Okay, the message is out when timo is zero. keramida> Thanks for the quick reply. I'll give a try to your patch tomorrow keramida> morning, when I have access to that machine again. You are welcome. Perhaps, I found the cause. sc->tz_zone is initialized before each retrieval of new value from BIOS. It makes the period where sc->tz_zone.tsp is zero. Please try following patch, instead: Index: sys/dev/acpica/acpi_thermal.c diff -u -p sys/dev/acpica/acpi_thermal.c.orig sys/dev/acpica/acpi_thermal.c --- sys/dev/acpica/acpi_thermal.c.orig Mon Aug 22 15:25:16 2005 +++ sys/dev/acpica/acpi_thermal.c Thu Aug 25 16:46:15 2005 @@ -347,7 +347,14 @@ acpi_tz_establish(struct acpi_tz_softc * 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++) { Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/