From owner-freebsd-acpi@FreeBSD.ORG Mon Jul 10 14:35:23 2006 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2D4D16A4FD for ; Mon, 10 Jul 2006 14:35:23 +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 2B33543D46 for ; Mon, 10 Jul 2006 14:35:22 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k6AEZ8dc061078; Mon, 10 Jul 2006 10:35:20 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: "M. Warner Losh" Date: Mon, 10 Jul 2006 10:34:38 -0400 User-Agent: KMail/1.9.1 References: <20060709.022224.-1827343921.imp@bsdimp.com> In-Reply-To: <20060709.022224.-1827343921.imp@bsdimp.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200607101034.38923.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Mon, 10 Jul 2006 10:35:20 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1590/Mon Jul 10 01:34:09 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: acpi@freebsd.org Subject: Re: Fw: PERFORCE change 101080 for review X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2006 14:35:23 -0000 On Sunday 09 July 2006 04:22, M. Warner Losh wrote: > > John, > > I think the following change is good reguardless of how the current > discussions about how to get acpi devices wired falls out. It > modifies devclass unit number assignment to treat a pre-existing > device as 'taken' as well as one that just might be hinted at. > > It has the nice side effect of obviating the need for device_set_unit, > which I added holding my nose a long time ago. The reason I didn't go > with this approach was that at the time (4.x or maybe 3.x) there > wasn't the hints infrastructure we have today, and I never went back > to revisit this kludge to remove it. > > Please let me know what you think of this. Well, I think perhaps you think my wiring stuff is just about serial ports, but it really would allow us to generically wire unit numbers based on properties of the device that the bus driver can verify (resources, location, etc.) Basically, I want the bus driver to decide if it wants to "claim" a hint device. That is, each time we go to probe a device, if there are any hint-enumerated devices for the child driver we are probing, we pass the device_t to the parent (bus) device_t and use a new bus_if.m method to ask the parent bus if it's ok for this device_t to "take over" the hint device (e.g. if the resources specified in the hint are a subset of the ACPI or PNPBIOS-enumerated resources). Since each bus is free to implement whatever algorithm it wants, we can also add creative things like: hint.foo.0.at="pci:0:4:0" (a PCI bus/device/function) or hint.foo.0.at="_SB_.PCI0.ISA0.FOO0" (an ACPI device name) because the bus (and not the MI subr_bus.c code) is determines what the hints mean. -- John Baldwin