From owner-freebsd-wireless@FreeBSD.ORG Sun May 8 09:43:15 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95351106566B for ; Sun, 8 May 2011 09:43:15 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 27C118FC14 for ; Sun, 8 May 2011 09:43:14 +0000 (UTC) Received: by bwz12 with SMTP id 12so4999880bwz.13 for ; Sun, 08 May 2011 02:43:13 -0700 (PDT) Received: by 10.204.84.142 with SMTP id j14mr3218599bkl.20.1304847792911; Sun, 08 May 2011 02:43:12 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-067-200-201.pools.arcor-ip.net [88.67.200.201]) by mx.google.com with ESMTPS id f21sm2998245bkd.23.2011.05.08.02.43.10 (version=SSLv3 cipher=OTHER); Sun, 08 May 2011 02:43:11 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: freebsd-wireless@freebsd.org Date: Sun, 8 May 2011 11:43:24 +0200 User-Agent: KMail/1.13.7 (FreeBSD/8.2-STABLE; KDE/4.6.2; amd64; ; ) References: <20110508082212.GA72727@solitaire.psych0tik.net> In-Reply-To: <20110508082212.GA72727@solitaire.psych0tik.net> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_8WmxN9fgqRawn8x" Message-Id: <201105081143.24478.bschmidt@freebsd.org> Cc: Subject: Re: Ath issues on -CURRENT > Mar 31 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:43:15 -0000 --Boundary-00=_8WmxN9fgqRawn8x Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Sunday 08 May 2011 10:22:12 richo wrote: > Hi, > > I use an atheros based pccard nic on my laptop with 9-CURRENT. > > The last time I was able to build a working kernel was 20 march (the current > kernel I'm using is=20 > FreeBSD solitaire.psych0tik.net 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r219786:= > Sun Mar 20 15:26:26 EST 2011 richo@solitaire.psych0tik.net:/usr/obj/us= > r/src/sys/GENERIC i386 > > a few weeks later UPDATING included this message: > 20110331: > ath(4) has been split into bus- and device- modules. if_ath contains > the HAL, the TX rate control and the network device code. if_ath_pci > contains the PCI bus glue. For Atheros MIPS embedded systems, if_ath_a > contains the AHB glue. Users need to load both if_ath_pci and if_ath > in order to use ath on everything else. > > TO REPEAT: if_ath_ahb is not needed for normal users. Normal users onl > need to load if_ath and if_ath_pci for ath(4) operation. > > I'm still using default config, but any kernels I build panic if I boot with > the NIC plugged in. They boot fine with it unplugged, but if I plug in the > card > it immediately panics. > > Booting with verbose logging on, I see this (I typed this out by hand after > writing it down, so it's possible that it's slightly incorrect. I did double > check it, though): > > pcib2: allocated memory range (0xf6010000-0xf601ffff) for rid 10 of pci0:3:0:0 > unkown: Lazy allovation of 0x10000 bytes rid 0x10 type 3 at 0xf6010000 > cbb0 Opening memory: > cbb0 Normal: (0xg6010000-0xf601ffff) > cbb0: Opening memory: > panic: duplcate map 10 > > I have confirmed with pciconf -l that pci0:3:0:0 is my ath nic. > > I have the backtrace, but I only wrote down the function names. I can write > down the whole lot if it will help though. I was running into the same issue with a ral(4) cardbus adapter. John Baldwin provided the attached patch which fixed the issue for me. -- Bernhard --Boundary-00=_8WmxN9fgqRawn8x Content-Type: text/x-patch; charset="ISO-8859-1"; name="cardbus_cis.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cardbus_cis.diff" Index: sys/dev/cardbus/cardbus_cis.c =================================================================== --- sys/dev/cardbus/cardbus_cis.c (revision 221619) +++ sys/dev/cardbus/cardbus_cis.c (working copy) @@ -430,7 +430,10 @@ cardbus_read_tuple_finish(device_t cbdev, device_t { if (res != CIS_CONFIG_SPACE) { bus_release_resource(child, SYS_RES_MEMORY, rid, res); +#if 0 + /* XXX: Not anymore. */ bus_delete_resource(child, SYS_RES_MEMORY, rid); +#endif } } Index: sys/dev/pci/pci.c =================================================================== --- sys/dev/pci/pci.c (revision 221619) +++ sys/dev/pci/pci.c (working copy) @@ -2576,6 +2576,17 @@ pci_add_map(device_t bus, device_t dev, int reg, s uint16_t cmd; struct resource *res; + /* + * The BAR may already exist if the device is a CardBus card + * whose CIS is stored in this BAR. + */ + pm = pci_find_bar(dev, reg); + if (pm != NULL) { + maprange = pci_maprange(pm->pm_value); + barlen = maprange == 64 ? 2 : 1; + return (barlen); + } + pci_read_bar(dev, reg, &map, &testval); if (PCI_BAR_MEM(map)) { type = SYS_RES_MEMORY; --Boundary-00=_8WmxN9fgqRawn8x--