Date: Fri, 11 Dec 2009 11:29:45 -0600 From: Brooks Davis <brooks@freebsd.org> To: pluknet <pluknet@gmail.com> Cc: jfv@freebsd.org, freebsd-current@freebsd.org Subject: Re: panic with em(4) in current Message-ID: <20091211172945.GC33467@lor.one-eyed-alien.net> In-Reply-To: <a31046fc0912101420v2ef8ec17gf9b9105c8128b79@mail.gmail.com> References: <20091210210901.GA23550@lor.one-eyed-alien.net> <a31046fc0912101420v2ef8ec17gf9b9105c8128b79@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Clx92ZfkiYIKRjnr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 11, 2009 at 01:20:08AM +0300, pluknet wrote: > 2009/12/11 Brooks Davis <brooks@one-eyed-alien.net>: > > 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 >=20 > Hi, I see bug there: > +#define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ > + MTX_NETWORK_LOCK, \ > + MTX_DEF | MTX_SPIN) >=20 > 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. If a spin mutex were actually needed here then the _LOCK and _UNLOCK macros need to be change and the unused _TRYLOCK macro needs to be removed. -- Brooks --Clx92ZfkiYIKRjnr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLIoGJXY6L6fI4GtQRAgaFAKDnrqmpAFZtNwbvzKmoWqg2yDuSbQCgi23Z gpyRaqmnF0ylGuvXp94KoG8= =4noO -----END PGP SIGNATURE----- --Clx92ZfkiYIKRjnr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091211172945.GC33467>