From owner-svn-src-user@FreeBSD.ORG Mon Nov 3 18:45:55 2008 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 866C21065773; Mon, 3 Nov 2008 18:45:52 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id AEB048FC14; Mon, 3 Nov 2008 18:45:51 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRP091877; Mon, 3 Nov 2008 13:45:45 -0500 (EST) (envelope-from john@baldwin.cx) From: John Baldwin To: Warner Losh Date: Mon, 3 Nov 2008 12:47:02 -0500 User-Agent: KMail/1.9.7 References: <200811020256.mA22uG1i026765@svn.freebsd.org> In-Reply-To: <200811020256.mA22uG1i026765@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811031247.02826.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:45:45 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r184549 - in user/imp/newcard/sys: dev/aic7xxx dev/ath dev/dc dev/firewire dev/fxp dev/if_ndis dev/ipw dev/malo dev/puc dev/ral dev/re dev/sio dev/sound/pci dev/uart dev/usb dev/vge dev... 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, 03 Nov 2008 18:45:55 -0000 On Saturday 01 November 2008 10:56:16 pm Warner Losh wrote: > Author: imp > Date: Sun Nov 2 02:56:16 2008 > New Revision: 184549 > URL: http://svn.freebsd.org/changeset/base/184549 > > Log: > MFp4(newcard): remove explicit cardbus driver attachments. > > Since the pci/cardbus refactor, these have been unnecessary. Well, > almost unnecessary. There's a bug somewhere in subr_bus.c that > prevents kldload from working entirely correctly. Remove them from my > tree in the hopes I'll fix that bug. The problem is that in device_probe_child() we only use the drivers attached to the devclass of the bus device. Probably what you would need to change would be to make a 'devclass_probe_child()' that takes a devclass and tries all the drivers for that devclass (basically, the first for-loop in device_probe_child()). Then I would change device_probe_child() to try any base devclasses the driver inherits from. You can find these in the "baseclasses" array in the 'driver_t' object. However, there are several edge cases to consider. For example, do you only try the "base" devclasses if none of the drivers in the main devclass match? Or do you do always do a full walk of all the devclasses to find the best driver? That is, suppose I have a driver hung off of "cardbus" that returns BUS_PROBE_GENERIC and a driver hung off of "pci" that returns BUS_PROBE_DEFAULT? I think I'd actually be inclined to prefer the "cardbus" driver. Thus, I would do one pass of the 'main' devclass and only walk the 'baseclasses' if I didn't get a matching device. For the walk of the baseclasses the same question applies. For that I'm less sure, though it is probably easier to implement a strategy where you stop the first time you find a devclass with a matching driver. -- John Baldwin