From owner-freebsd-sparc64@FreeBSD.ORG Thu Aug 4 18:05:13 2005 Return-Path: X-Original-To: sparc64@freebsd.org Delivered-To: freebsd-sparc64@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5EC9416A41F; Thu, 4 Aug 2005 18:05:13 +0000 (GMT) (envelope-from marius@newtrinity.zeist.de) Received: from newtrinity.zeist.de (newtrinity.zeist.de [217.24.217.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB67243D45; Thu, 4 Aug 2005 18:05:12 +0000 (GMT) (envelope-from marius@newtrinity.zeist.de) Received: from newtrinity.zeist.de (localhost [127.0.0.1]) by newtrinity.zeist.de (8.12.11/8.12.11/ZEIST.DE) with ESMTP id j74I5Awc067960; Thu, 4 Aug 2005 20:05:10 +0200 (CEST) (envelope-from marius@newtrinity.zeist.de) Received: (from marius@localhost) by newtrinity.zeist.de (8.12.11/8.12.10/Submit) id j74I55qE067959; Thu, 4 Aug 2005 20:05:05 +0200 (CEST) (envelope-from marius) Date: Thu, 4 Aug 2005 20:05:05 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20050804200505.A67677@newtrinity.zeist.de> References: <200508041253.18343.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200508041253.18343.jhb@FreeBSD.org>; from jhb@freebsd.org on Thu, Aug 04, 2005 at 12:53:17PM -0400 X-AntiVirus: checked by AntiVir Milter (version: 1.1.0-7; AVE: 6.31.1.0; VDF: 6.31.1.54; host: newtrinity.zeist.de) Cc: sparc64@freebsd.org Subject: Re: Patch to fix locking nits in hme X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 18:05:13 -0000 On Thu, Aug 04, 2005 at 12:53:17PM -0400, John Baldwin wrote: > I have a patch to fix several nits in the hme(4) driver's locking including: > > - Using the driver lock instead of Giant in a busdma callback. > - Using callout_drain() in detach. > - Locking access to the mii registers with the driver lock. > - Clearing the RUNNING and OACTIVE flags in stop. > - Re-enabling updating the media from hme_init_locked(). > - Making the mutex non-recursive. > - Fixing locking in ioctl. > > Patch is at http://www.freebsd.org/~jhb/patches/hme_locking.patch > @@ -871,11 +859,7 @@ #endif /* Set the current media. */ - /* - * HME_UNLOCK(sc); - * mii_mediachg(sc->sc_mii); - * HME_LOCK(sc); - */ + mii_mediachg(sc->sc_mii); Calling mii_mediachg() will trigger some unsolved problems with the MIF configuration (most likely) which used to cause dhclient(8) not working on Ultra 2 and result in no link at all on Netra T1.