From owner-svn-src-user@FreeBSD.ORG Mon Feb 2 05:13:54 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 609C5106566B; Mon, 2 Feb 2009 05:13:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 141A58FC16; Mon, 2 Feb 2009 05:13:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1410318rvf.43 for ; Sun, 01 Feb 2009 21:13:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=kjOWWWMTNwSdK6A7y8iPw9FaeI8p2U47aC2/EVmUfb8=; b=D2lqTsZpZVmCR/R4uhlhK0PNzjLzJSqXlZB+iFdV732rRGM97jYlAW09OXS5Z2NKPo gYPAC73ysb2Ea/hcJl1gE2Xs72UpmNGsKd+40pKY+py4/E75uVvCEq5XFpzsvPLnRRpe nJwNqmg8mSY+udxEF3gYPqfFnq5YscZPDkklo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=xb0CICS8AXhlpWiT+RHBJk5R2rQ63Pdd+/w+405Xhnvy3c+ewOKdTfS7Rq6RorPGDy S3SO27FQd7vcvJRcmqm/CKIjXmW7pxk/54/EvikwargNHVJW6BOOQR3G6UINNdNpUZSH CLcpwwjuTMFNUcU4NU52hS0tZPmdyNTxg+cq8= Received: by 10.141.99.2 with SMTP id b2mr2110589rvm.46.1233551633835; Sun, 01 Feb 2009 21:13:53 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id g14sm2349501rvb.1.2009.02.01.21.13.51 (version=SSLv3 cipher=RC4-MD5); Sun, 01 Feb 2009 21:13:53 -0800 (PST) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Mon, 2 Feb 2009 14:14:21 +0900 From: Pyun YongHyeon Date: Mon, 2 Feb 2009 14:14:21 +0900 To: "M. Warner Losh" Message-ID: <20090202051421.GE43513@michelle.cdnetworks.co.kr> References: <20090201213749.GJ32503@citylink.fud.org.nz> <20090201.203618.1640016624.imp@bsdimp.com> <20090202044416.GC43513@michelle.cdnetworks.co.kr> <20090201.215218.1013608033.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090201.215218.1013608033.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: 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 Reply-To: pyunyh@gmail.com 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, 02 Feb 2009 05:13:54 -0000 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.