From owner-freebsd-current@FreeBSD.ORG Fri Oct 12 19:21:35 2007 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 CD8AA16A418 for ; Fri, 12 Oct 2007 19:21:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF5213C45D for ; Fri, 12 Oct 2007 19:21:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 214169643-1834499 for multiple; Fri, 12 Oct 2007 15:19:36 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l9CJLIM6041669; Fri, 12 Oct 2007 15:21:20 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Fri, 12 Oct 2007 14:09:31 -0400 User-Agent: KMail/1.9.6 References: <200710111741.34992.jhb@FreeBSD.org> <622950DD-BFEF-450C-8B80-BAB55C7B58CB@mac.com> In-Reply-To: <622950DD-BFEF-450C-8B80-BAB55C7B58CB@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710121409.31407.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, 12 Oct 2007 15:21:20 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/4533/Fri Oct 12 06:59:29 2007 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: current@freebsd.org Subject: Re: New-bus unit wiring via hints.. 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 Oct 2007 19:21:35 -0000 On Thursday 11 October 2007 05:59:23 pm Marcel Moolenaar wrote: > > On Oct 11, 2007, at 2:41 PM, John Baldwin wrote: > > > 2) One of the things this fixes that is visible to users is that if > > your > > machine gets the COM ports backwards when using ACPI it should > > now get > > them correct (COM1 as sio0) assuming your COM ports use the > > default hints > > and you have the default sio hints in your /boot/device.hints file. > > I think you just pointed out the problem of using hints to wire > down unit numbers, because hints will stop hinting and will start > dictating. If I swap the serial ports in the BIOS then surely > my hints will be wrong and ACPI will be right. A default hints > file will be even more disastrous than before. hints have always dictated. The issue is that hints are enumerating devices that ACPI/PNPBIOS also dictate, so how does one resolve the differences (do you ignore one or the other, or attempt to merge them, etc.). Note that hints can always be removed. FWIW, the resources for COM1 and COM2 are largely fixed in practice on existing x86 hardware which is what this would affect, and hints can always be removed. Given the number of complaints from people where ACPI enumerates COM2 before COM1 (and the fact that ACPI made _UID useless by not giving it a more strict format.. it's optional and on some systems it is 0-based while on others it is 1-based. I've also seen pci link devices where the _UID is the link index from the $PIR table which == the register offset in config space on the PCI-ISA bridge of the controlling register) and the fact that COM1 and COM2 have de-facto fixed resources on x86, I think it's ok for x86 to include default hints for sio0 and sio1. Do you have any comments on the idea in general of allowing busses to use hints (or some other method) to wire devices to unit numbers? Note that some other examples you could do would be to expand ACPI hinting to allow for things like: hint.foo.0.uid="1" (bind to _UID=1) hint.foo.0.name="COMA" (short name) hint.foo.0.name="\_SB_.PCI0.LPC0.COMA" (long name) In fact, I have uid done as a prototype currently and the way I did it was that the _UID matching took precedence over resource matching, but that policy is up to the bus driver. -- John Baldwin