From owner-freebsd-current@FreeBSD.ORG Sat May 31 14:05:58 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 9E3FC37B401 for ; Sat, 31 May 2003 14:05:58 -0700 (PDT) Received: from gold.he.net (gold.he.net [216.218.149.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BE1043FA3 for ; Sat, 31 May 2003 14:05:58 -0700 (PDT) (envelope-from daver@gomerbud.com) Received: from tombstone.localnet.gomerbud.com (adsl-64-161-56-54.dsl.snlo01.pacbell.net [64.161.56.54]) by gold.he.net (8.8.6p2003-03-31/8.8.2) with ESMTP id OAA11533 for ; Sat, 31 May 2003 14:05:55 -0700 Received: by tombstone.localnet.gomerbud.com (Postfix, from userid 1001) id 6D8E8395; Sat, 31 May 2003 14:06:00 -0700 (PDT) Date: Sat, 31 May 2003 14:06:00 -0700 From: "David P. Reese Jr." To: current@freebsd.org Message-ID: <20030531210600.GA670@tombstone.localnet.gomerbud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: 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: Sat, 31 May 2003 21:05:58 -0000 In rev 1.214 of sys/dev/pci/pci.c, we have started checking if a pci_set_command_bit() was successful with a subsequent PCI_READ_CONFIG and comparing the results. For some odd reason, this doesnt work when my viapropm tries to attach. Allocating its port resources fails in pci_enable_io_method(). The code in question is: sys/dev/pci/pci.c:pci_enable_io_method() [snip] 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); What is annoying is that by changing the last line to return a zero instead of ENXIO, the viapropm successfully attaches. The smbus interface even works. Everything else that tries to claim port resources succeeds. Is it my chipset's fault for not reading back the correct register value? The board is a SOYO K7VTAPRO-2AA6. What other info would be helpful in this situation? viapropm0@pci0:7:4: class=0x068000 card=0x30571106 chip=0x30571106 rev=0x40 hdr=0x00 vendor = 'VIA Technologies Inc' device = 'VT82C686A/B ACPI Power Management Controller' class = bridge subclass = PCI-unknown -- 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)