From owner-freebsd-current@FreeBSD.ORG Fri Mar 23 04:00:26 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49C3A16A400 for ; Fri, 23 Mar 2007 04:00:26 +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 C43A613C4AE for ; Fri, 23 Mar 2007 04:00:25 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 l2N40Gl5075775; Thu, 22 Mar 2007 23:00:18 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Wolfskill Date: Fri, 23 Mar 2007 00:00:00 -0400 User-Agent: KMail/1.9.6 References: <46025922.4090809@vlink.ru> <20070322221341.GN39764@bunrab.catwhisker.org> <20070323023513.GO39764@bunrab.catwhisker.org> In-Reply-To: <20070323023513.GO39764@bunrab.catwhisker.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703230000.01527.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]); Thu, 22 Mar 2007 23:00:19 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2906/Thu Mar 22 17:03:02 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, "M. Warner Losh" Subject: Re: no network access on today's CURRENT 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, 23 Mar 2007 04:00:26 -0000 On Thursday 22 March 2007 10:35:13 pm David Wolfskill wrote: > On Thu, Mar 22, 2007 at 03:13:41PM -0700, David Wolfskill wrote: > > ... > > Following up on Bruce's suggestion, then, I reverted the files that > > appeared most likely to be involved to 20 Mar 2007 03:00 (US/Pacific; > > currently 7 hrs. west of UTC) and re-built the kernel. > > > > A reboot following that exercise yields a functioning wi0: > >... > > Here's a list of the files I reverted (pruned from a list of files that > > were updated in yesterday's build process), together with the revision > > level I'm using & the current revision level: > > I was able to trim the list by some experimenting: > > > File wi0 OK no wi0 > > sys/dev/acpica/acpi.c 1.231 1.233 > > sys/i386/bios/smapi.c 1.13 1.14 > > sys/i386/bios/smbios.c 1.5 1.6 > > sys/i386/bios/vpd.c 1.5 1.6 > > sys/i386/i386/legacy.c 1.61 1.62 > > sys/i386/i386/nexus.c 1.69 1.71 > >... > > So: the above set of changes makes the difference between my wi0 device > being seen (or not) during kernel probes. > > The probe messages from this latest (successful) boot related to the wi0 > device are: > > ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA33 cable=40 wire > pcib2: pccard2 requested memory range 0xf4000000-0xfbffffff: good > pccard2: CIS version PC Card Standard 5.0 > pccard2: CIS info: Dell, TrueMobile 1150 Series PC Card, Version 01.01, > pccard2: Manufacturer code 0x156, product 0x2 > pccard2: function 0: network adapter, ccr addr 3e0 mask 1 > pccard2: function 0, config table entry 1: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqpulse irqlevel > pcib2: pccard2 requested I/O range 0xe000-0xffff: in range > pcib2: pccard2 requested memory range 0xf4000000-0xfbffffff: good > wi0: at port 0xe000-0xe03f irq 11 function 0 config 1 on pccard2 > wi0: [MPSAFE] > wi0: [ITHREAD] > wi0: using Lucent Embedded WaveLAN/IEEE > wi0: Lucent Firmware: Station (6.14.1) > wi0: bpf attached > wi0: Ethernet address: 00:02:2d:5b:2c:78 > wi0: bpf attached > wi0: bpf attached > wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps > ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire > > The corresponding messages from a boot that fails to see wi0: > > ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA33 cable=40 wire > pcib2: pccard2 requested memory range 0xf4000000-0xfbffffff: good > cbb2: set_res_flags: specified resource not active > CIS is too long -- truncating > cbb2: set_res_flags: specified resource not active > pccard2: Card has no functions! > cbb2: PC Card card activation failed > ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire > > Thanks for suggestions; still willing to test. Actually, this may be due to weirdness in exca.c, it tries to use bus tags and bus handles on a resource before it is activated. I think I see how to fix it by making exca_activate_resource() calling BUS_ACTIVATE_RESOURCE() first. Try this patch: Index: dev/exca/exca.c =================================================================== RCS file: /usr/cvs/src/sys/dev/exca/exca.c,v retrieving revision 1.27 diff -u -r1.27 exca.c --- dev/exca/exca.c 24 Feb 2007 15:56:06 -0000 1.27 +++ dev/exca/exca.c 23 Mar 2007 03:57:09 -0000 @@ -259,11 +259,11 @@ } } if (win >= EXCA_MEM_WINS) - return (1); + return (ENOSPC); if (((rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT) & 0xff) != 0 && (sc->flags & EXCA_HAS_MEMREG_WIN) == 0) { device_printf(sc->dev, "Does not support mapping above 24M."); - return (1); + return (EINVAL); } sc->mem[win].cardaddr = 0; @@ -477,7 +477,7 @@ } } if (win >= EXCA_IO_WINS) - return (1); + return (ENOSPC); sc->io[win].iot = rman_get_bustag(r); sc->io[win].ioh = rman_get_bushandle(r); @@ -789,24 +789,25 @@ int rid, struct resource *res) { int err; - if (!(rman_get_flags(res) & RF_ACTIVE)) { /* not already activated */ - switch (type) { - case SYS_RES_IOPORT: - err = exca_io_map(exca, PCCARD_WIDTH_AUTO, res); - break; - case SYS_RES_MEMORY: - err = exca_mem_map(exca, PCCARD_A_MEM_COM, res); - break; - default: - err = 0; - break; - } - if (err) - return (err); + if (rman_get_flags(res) & RF_ACTIVE) + return (0); + err = BUS_ACTIVATE_RESOURCE(device_get_parent(exca->dev), child, + type, rid, res); + if (err) + return (err); + switch (type) { + case SYS_RES_IOPORT: + err = exca_io_map(exca, PCCARD_WIDTH_AUTO, res); + break; + case SYS_RES_MEMORY: + err = exca_mem_map(exca, PCCARD_A_MEM_COM, res); + break; } - return (BUS_ACTIVATE_RESOURCE(device_get_parent(exca->dev), child, - type, rid, res)); + if (err) + BUS_DEACTIVATE_RESOURCE(device_get_parent(exca->dev), child, + type, rid, res); + return (err); } int -- John Baldwin