From owner-svn-src-user@FreeBSD.ORG Mon Feb 9 22:52:29 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5BD81065698 for ; Mon, 9 Feb 2009 22:52:29 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D19F18FC17 for ; Mon, 9 Feb 2009 22:52:29 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id C49AD1A3C3A; Mon, 9 Feb 2009 14:34:39 -0800 (PST) Date: Mon, 9 Feb 2009 14:34:39 -0800 From: Alfred Perlstein To: "M. Warner Losh" Message-ID: <20090209223439.GP68801@elvis.mu.org> References: <20090202044416.GC43513@michelle.cdnetworks.co.kr> <20090201.215218.1013608033.imp@bsdimp.com> <20090202051421.GE43513@michelle.cdnetworks.co.kr> <20090201.222119.-1303462184.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090201.222119.-1303462184.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: pyunyh@gmail.com, src-committers@freebsd.org, thompsa@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r187978 - user/thompsa/usb/sys/dev/usb2/ethernet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:52:30 -0000 * M. Warner Losh [090201 21:24] wrote: > In message: <20090202051421.GE43513@michelle.cdnetworks.co.kr> > Pyun YongHyeon writes: > : On Sun, Feb 01, 2009 at 09:52:18PM -0700, M. Warner Losh wrote: > : > In message: <20090202044416.GC43513@michelle.cdnetworks.co.kr> > : > Pyun YongHyeon writes: > : > : On Sun, Feb 01, 2009 at 08:36:18PM -0700, M. Warner Losh wrote: > : > : > In message: <20090201213749.GJ32503@citylink.fud.org.nz> > : > : > Andrew Thompson writes: > : > : > : On Sun, Feb 01, 2009 at 02:28:08PM -0700, M. Warner Losh wrote: > : > : > : > In message: <200902010650.n116obU1045871@svn.freebsd.org> > : > : > : > Andrew Thompson writes: > : > : > : > : + locked = mtx_owned(&sc->sc_mtx); > : > : > : > : + if (!locked) > : > : > : > : + AUE_LOCK(sc); > : > : > : > > : > : > : > You do know this is racy, right? > : > : > : > : > : > : Yea... It only get called unlocked during mii probe+attach so its fine. > : > : > : I havnt actaully checked if its ok to hold a mutex during > : > : > : mii_phy_probe() which would make this go away. > : > : > > : > : > You hold GIANT when probe+attach, which means I think you can't > : > : > : > : AFAIK this is not true on USB2 and I think this is reason why > : > : it have to lock/unlock dance in probe/attach. > : > > : > It is a newbus requirement that all probe/attach routines have to be > : > called with GIANT held. > : > > : > : If this can be done on USB2 it would greatly simplify MII attach > : part as well as locks used in MII access routines in all USB2 > : ethernet drivers. I vaguely remember I asked for this to HPS, but > : he seem to forget about it. > > I'll take a look into the matter in more detail. It is an absolute > requirement of newbus at the moment that any call to > device_probe_and_attach(), including bus_generic_attach(). Can some asserts be added? Maybe under an additonal ifdef considering usb2 for a short time? -- - Alfred Perlstein