From owner-freebsd-current@FreeBSD.ORG Fri Sep 12 18:23:02 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F071065672 for ; Fri, 12 Sep 2008 18:23:02 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 08D518FC25 for ; Fri, 12 Sep 2008 18:23:01 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id m8CIMtXY048645; Fri, 12 Sep 2008 12:22:56 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <48CAB37F.50002@samsco.org> Date: Fri, 12 Sep 2008 12:22:55 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Hans Petter Selasky References: <48B3299F.5080101@vwsoft.com> <20080911103343.GH1413@rink.nu> <20080911.082418.775964060.imp@bsdimp.com> <200809112044.43749.hselasky@c2i.net> <48C9977C.2030104@samsco.org> In-Reply-To: <48C9977C.2030104@samsco.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: rink@freebsd.org, current@freebsd.org, fbsd-current@mawer.org, freebsd-usb@freebsd.org, volker@vwsoft.com, "M. Warner Losh" Subject: Re: "legacy" usb stack fixes 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: Fri, 12 Sep 2008 18:23:02 -0000 Scott Long wrote: > This is close to How Things Should Be. Each umass target having its own > SIM and bus is indeed wrong, but I'm not sure if it's correct for all > USB controllers and buses to be under a single SIM. What would be the > most correct is for each physical USB controller/bus instance to have > its own SIM instance. I don't know if it's better to do the attachment > in ehci/ohci/uhci controller drivers or in usb bus driver; up in the > controller drivers is probably more correct. I don't like this hack of > attaching stuff in a SYSINIT. > > Scott > > Now that I've thought some on it, I'll go one step further and say that registering a single SIM for multiple controller+bus instances in a SYSINIT will be highly undesirable thing to do. Since you have to register a lock with the CAM when you register the SIM, you'll wind up serializing all of the USB controllers under a single lock. Or you'll probably try something dangerous and tricky with dropping the new global lock and picking up an individual lock, then swizzling locks in the completion and event paths, with the result being rather unsatisfying and unpleasant. So I know that you'll do what you believe is correct, but please take my advice on the matter anyways. Scott