From owner-freebsd-current@FreeBSD.ORG Sat Dec 12 02:42:59 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 7B62A1065670; Sat, 12 Dec 2009 02:42:59 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213]) by mx1.freebsd.org (Postfix) with ESMTP id B047B8FC0C; Sat, 12 Dec 2009 02:42:58 +0000 (UTC) Received: by ewy5 with SMTP id 5so1712016ewy.14 for ; Fri, 11 Dec 2009 18:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=MaYoX3e//R4iRM3v3LQ1hywIoUAelGa7vLPfK6pYFrE=; b=v5Gibpk9g9mWOb+nH0pX2aWu59H5FmkztvcNnao07Dzj/4fwkarZjYaqcjT5jTu0Om 52AtgZcUuk9UbP32hchzWf5RJ6jTlNxfIiBFknMvqIPECoVRm9FT+AnNVrO6NHjjhj81 UGgtnYHxr9ibImKsT85nDvEKYR6MU1Hc0sego= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=F4q+KTBanXetqd77UNhe8kNg3LFi8crZg8kqhRCSWqo0A7iLo6w6vtKcKMntsPmVWg bQyhsZEqisVNRCZobb84AdKClooAZFGNHOHb6xTS15CVSmUsB3nZ5LW1kmTchhR5gpGJ 4MucWUwfnCvXSc9ELKT0k3ep1zEQEvtvC+Hwk= MIME-Version: 1.0 Received: by 10.216.86.16 with SMTP id v16mr853073wee.162.1260585777664; Fri, 11 Dec 2009 18:42:57 -0800 (PST) In-Reply-To: <87y6l99beu.fsf@kobe.laptop> References: <20091210210901.GA23550@lor.one-eyed-alien.net> <20091211172945.GC33467@lor.one-eyed-alien.net> <87y6l99beu.fsf@kobe.laptop> Date: Fri, 11 Dec 2009 18:42:57 -0800 Message-ID: <2a41acea0912111842w67c0d822obfa396f7dd8ca5a9@mail.gmail.com> From: Jack Vogel To: Giorgos Keramidas Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: jfv@freebsd.org, Brooks Davis , 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:43:00 -0000 Sorry all, this code was put in by someone making changes to the shared code, odd however that the panic was not seen in testing. My wife had serious surgery today so I have been at the hospital all day, I will get this fixed first thing after the weekend. Jack On Fri, Dec 11, 2009 at 6:24 PM, Giorgos Keramidas wrote: > 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. > >