From owner-freebsd-current@FreeBSD.ORG Sat Dec 12 02:25:14 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F3FE106566B for ; Sat, 12 Dec 2009 02:25:14 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 8A1D78FC0A for ; Sat, 12 Dec 2009 02:25:13 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 80632EB47D2; Sat, 12 Dec 2009 04:25:12 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 6DE3D452FB; Sat, 12 Dec 2009 04:25:12 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xiRIQZbvUBxk; Sat, 12 Dec 2009 04:25:12 +0200 (EET) Received: from kobe.laptop (ppp-94-64-250-32.home.otenet.gr [94.64.250.32]) by mail.ceid.upatras.gr (Postfix) with ESMTP id F0397451B2; Sat, 12 Dec 2009 04:25:11 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id nBC2P90e038054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Dec 2009 04:25:10 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id nBC2P8e1038049; Sat, 12 Dec 2009 04:25:08 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Brooks Davis References: <20091210210901.GA23550@lor.one-eyed-alien.net> <20091211172945.GC33467@lor.one-eyed-alien.net> Date: Sat, 12 Dec 2009 04:24:57 +0200 In-Reply-To: <20091211172945.GC33467@lor.one-eyed-alien.net> (Brooks Davis's message of "Fri, 11 Dec 2009 11:29:45 -0600") Message-ID: <87y6l99beu.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: jfv@freebsd.org, pluknet , freebsd-current@freebsd.org Subject: Re: panic with em(4) in current 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: Sat, 12 Dec 2009 02:25:14 -0000 --=-=-= On Fri, 11 Dec 2009 11:29:45 -0600, Brooks Davis wrote: > On Fri, Dec 11, 2009 at 01:20:08AM +0300, pluknet wrote: >> 2009/12/11 Brooks Davis : >> > Something with the latest e1000 update in current causes a panic during >> > attach on my laptop. ?Rolling sys/dev/e1000 back to the previous version >> > fixes the problem. ?Here's the hand transcribed panic: >> > >> > panic: mtx_lock() of spin mutex &dev_spec->swflag_mutex @ ../../../dev/e1000/e1000_ich8lan.c:651 >> > >> > The back trace places me at: e1000_acquire_swflag_ich8lan()+0x30 >> >> Hi, I see bug there: >> +#define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ >> + MTX_NETWORK_LOCK, \ >> + MTX_DEF | MTX_SPIN) >> >> mtx_init() first looks for MTX_SPIN flag and assign >> lock_class_mtx_spin class to mutex. >> Then mtx_lock() on spin mutex called. > > I can confirm that removing MTX_SPIN fixes the panic. This is invalid > code because MTX_DEF and MTX_SPIN are exclusive flags. Unfortunately, > MTX_DEF is 0x0 so there's no way to check for that error at runtime. FWIW, I see the same panic, and will be building a kernel without MTX_SPIN in a few minutes. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAksi/wEACgkQ1g+UGjGGA7Y5AgCfTw60DDydLRB67jBAXuQNmA/9 cBAAnA5QMBuKVd3ni+o/PSDqg/ZawcQr =+AOm -----END PGP SIGNATURE----- --=-=-=--