From owner-freebsd-net@FreeBSD.ORG Tue Nov 11 14:03:56 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A96EE16A4CE; Tue, 11 Nov 2003 14:03:56 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50A2843FE1; Tue, 11 Nov 2003 14:03:54 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id hABM3pOT017776; Tue, 11 Nov 2003 14:03:51 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id hABM3pVT017773; Tue, 11 Nov 2003 14:03:51 -0800 Date: Tue, 11 Nov 2003 14:03:51 -0800 From: Brooks Davis To: pdeuskar@freebsd.org Message-ID: <20031111220351.GA14761@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: net@freebsd.org Subject: locking issues in em_watchdog X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 22:03:56 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable em_watchdog() currently does not lock around the call to em_stop which means that if the lock is not held, it panics. I recently ran into this problem when the ACPI/SMP commits broke one of my machines. The following patch keeps the watchdog timer from being an instant panic on this system. It doesn't make the driver work, but I don't think that's actually a driver issue. -- Brooks =3D=3D=3D=3D //depot/user/brooks/xname/sys/dev/em/if_em.c#7 - /home/brooks/= working/freebsd/p4/xname/sys/dev/em/if_em.c =3D=3D=3D=3D @@ -767,8 +767,10 @@ =20 ifp->if_flags &=3D ~IFF_RUNNING; =20 + EM_LOCK(adapter); em_stop(adapter); - em_init(adapter); + em_init_locked(adapter); + EM_UNLOCK(adapter); =20 ifp->if_oerrors++; return; --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --jI8keyz6grp/JLjh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/sVy7XY6L6fI4GtQRAuGqAJ44TFl6x8nq7mmstkCLVxYE45clUQCfYWFL Gde54tVdupt3jzoFkio3qA8= =iXJf -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--