From owner-freebsd-current@FreeBSD.ORG Wed Jun 4 00:29:06 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78ED537B401 for ; Wed, 4 Jun 2003 00:29:06 -0700 (PDT) Received: from gold.he.net (gold.he.net [216.218.149.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2BBA43F75 for ; Wed, 4 Jun 2003 00:29:05 -0700 (PDT) (envelope-from daver@gomerbud.com) Received: from tombstone.localnet.gomerbud.com (adsl-64-166-167-150.dsl.snlo01.pacbell.net [64.166.167.150]) by gold.he.net (8.8.6p2003-03-31/8.8.2) with ESMTP id AAA14494; Wed, 4 Jun 2003 00:29:02 -0700 Received: by tombstone.localnet.gomerbud.com (Postfix, from userid 1001) id 14BE13CA; Wed, 4 Jun 2003 00:29:08 -0700 (PDT) Date: Wed, 4 Jun 2003 00:29:07 -0700 From: "David P. Reese Jr." To: Nicolas Souchu Message-ID: <20030604072907.GA10742@tombstone.localnet.gomerbud.com> References: <20030602222009.A16160@armor.free.fr> <20030603175430.GA4039@tombstone.localnet.gomerbud.com> <20030604072931.E33869@armor.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030604072931.E33869@armor.free.fr> User-Agent: Mutt/1.4i Sender: cc: "David P. Reese Jr." cc: current@freebsd.org Subject: Re: viapropm doesnt like sys/dev/pci.c rev 1.214 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 04 Jun 2003 07:29:06 -0000 On Wed, Jun 04, 2003 at 07:29:31AM +0000, Nicolas Souchu wrote: > On Tue, Jun 03, 2003 at 10:54:30AM -0700, David P. Reese Jr. wrote: > > [...] > > : The datasheet states that the command bits are RW but "fixed at 0". > > > > A snip of code from sys/dev/pci/pci.c:pci_enable_io_method(): > > > > pci_set_command_bit(dev, child, bit); > > command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); > > if (command & bit) > > return (0); > > device_printf(child, "failed to enable %s mapping!\n", error); > > return (ENXIO); > > > > Because the viapropm's command register bits will always read as zero, > > this code will always fail when trying to enable port mapping. > > > > Whatever problems viapropm may have, it is the new pci code that prevents it > > from attaching. It is not the fault of anything in sys/pci/viapm.c. > > And I personally don't know how to fix it except by an option with an > ifdef to workaround it. How about adding another flag to bus_alloc_resource() which would signal that we are not to check the value of the command register after calling pci_set_command_bit(). RF_WILLFAIL? After pci_enable_io_method() gets swallowed into pci_alloc_resource(), this would be pretty easy because the flag would be in scope when we check the value of the command register. I can do so this weekend if anyone thinks this is worthwhile. -- David P. Reese Jr. daver@gomerbud.com -------------------------------------------------------------------------- It can be argued that returning a NULL pointer when asked to allocate zero bytes is a silly response to a silly question. -- FreeBSD manual page for malloc(3)