From owner-freebsd-current@FreeBSD.ORG Wed Apr 6 07:34:45 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E4701065670; Wed, 6 Apr 2011 07:34:45 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1EB8FC24; Wed, 6 Apr 2011 07:34:43 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=upTJuTb3ngPPUUVVSPoyO7jwIWz3rzPtkQxI490l6Ks= c=1 sm=1 a=IU0TiZmyZPMA:10 a=dBRESv0yCI8A:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6DktU5ojhI3KT9BTFMwA:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 109209700; Wed, 06 Apr 2011 09:34:42 +0200 Received-SPF: softfail receiver=mailfe05.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 6 Apr 2011 09:33:47 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201104051321.56319.hselasky@freebsd.org> <201104051455.33853.hselasky@freebsd.org> <4D9B473F.8020607@FreeBSD.org> In-Reply-To: <4D9B473F.8020607@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104060933.47350.hselasky@freebsd.org> Cc: "freebsd-current@FreeBSD.org" , Andriy Gapon Subject: Re: use_generic and usb probing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 07:34:45 -0000 On Tuesday 05 April 2011 18:45:51 Andriy Gapon wrote: > on 05/04/2011 15:55 Hans Petter Selasky said the following: > > On Tuesday 05 April 2011 14:50:43 Andriy Gapon wrote: > >> I believe that newbus already supports ordering of children on a bus. > >> > >> BTW, does USB have to pass anything from probe to attach? > > > > Mostly only the driver info field. To avoid duplicate lookups. > > > >> Duplicate lookup is of course not very nice, but duplicate probing pass > >> is not nice either. > > > > This can all be avoided if the bus-drivers are sorted correctly before > > probing! Hi, > > Well, I think that that's what probe priorities actually for. > I also think that typically ivars should be set by a bus driver. So maybe > it's not such a good idea to pass data from probe to attach via ivars in > child drivers. But I could be mistaken about that. > The same device_t is used to do all the probes! > Practically speaking, you most likely don't have to worry about that for > drivers that return BUS_PROBE_SPECIFIC (=0) from their probe methods. And > there is only a few "generic" drivers that can be handled on a case by > case basis. There are more drivers that needs patching! Please scan all of the kernel files for usbdi.h and the use_generic flag. After looking at subr_usb.c I see your solution is fine as long as the PROBE() method that it attaches is the last one called before ATTACH(). If this is documented in how newbus should function, then please go ahead updating your patch to cover all USB drivers using use_generic. --HPS