From owner-p4-projects@FreeBSD.ORG Fri Sep 15 20:48:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 33FA116A593; Fri, 15 Sep 2006 20:48:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD7BC16A591 for ; Fri, 15 Sep 2006 20:48:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05D0643D53 for ; Fri, 15 Sep 2006 20:48:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8FKmOq0053408; Fri, 15 Sep 2006 16:48:24 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Hans Petter Selasky Date: Fri, 15 Sep 2006 16:47:20 -0400 User-Agent: KMail/1.9.1 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> <200609151243.50388.jhb@freebsd.org> <200609152039.28868.hselasky@c2i.net> In-Reply-To: <200609152039.28868.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609151647.20432.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 15 Sep 2006 16:48:25 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1885/Fri Sep 15 07:19:10 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 20:48:39 -0000 On Friday 15 September 2006 14:39, Hans Petter Selasky wrote: > Maybe a missing "if (*dmd->dmd_devclass == NULL)" here. It is not a big > problem. All the USB probe / attach code is currently executed under Giant, > so there should not be any race condition. "devclass_find_internal()" > allocates memory with M_NOWAIT, and will not sleep and cause problems. Well, as long as new-bus eventually has locking to handle concurrent driver adds (probably just a big sx lock around the whole thing) it will be fine. > > typedef struct devclass *devclass_t; > > > > Basically, passing a devclass_t into DRIVER_MODULE() just gives you a > > pre-intialized pointer to your devclass. The devclass's aren't bound to > > that devclass_t though, they are bound to the name. Thus if you have: > > > > static devclass_t foo_class, bar_class; > > > > static driver_t foo_driver { > > "foo", ... > > }; > > > > static driver_t bar_driver { > > "foo", ... > > }; > > > > DRIVER_MODULE(..., foo_driver, foo_devclass, ...); > > DRIVER_MODULE(..., bar_driver, bar_devclass, ...); > > > > Yes, but I cannot set the "devclass" to "NULL" ? That will panic according to > the "driver_module_handler()" function ?? Yes. I actually want to just remove it altogether because for almost all drivers it's worthless and just wastes space (granted, all of 1 pointer in the data seg of each driver). -- John Baldwin