Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2011 09:52:25 +1000
From:      richo <richo@psych0tik.net>
To:        freebsd-wireless@freebsd.org
Cc:        Bernhard Schmidt <bschmidt@freebsd.org>
Subject:   Re: Ath issues on -CURRENT > Mar 31
Message-ID:  <20110509235225.GA19432@richh-desktop.boxdice.com.au>
In-Reply-To: <201105081143.24478.bschmidt@freebsd.org>
References:  <20110508082212.GA72727@solitaire.psych0tik.net> <201105081143.24478.bschmidt@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 08/05/11 11:43 +0200, Bernhard Schmidt wrote:
>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 cur=
rent
>> kernel I'm using is=3D20
>> FreeBSD solitaire.psych0tik.net 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r2197=
86:=3D
>>   Sun Mar 20 15:26:26 EST 2011     richo@solitaire.psych0tik.net:/usr/ob=
j/us=3D
>> 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 contai=
ns
>>       the HAL, the TX rate control and the network device code. if_ath_p=
ci
>>       contains the PCI bus glue. For Atheros MIPS embedded systems, if_a=
th_a
>>       contains the AHB glue. Users need to load both if_ath_pci and if_a=
th
>>       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 t=
he
>> card
>> it immediately panics.
>>
>> Booting with verbose logging on, I see this (I typed this out by hand af=
ter
>> writing it down, so it's possible that it's slightly incorrect. I did do=
uble
>> 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 wr=
ite
>> 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.
>
>--=20
>Bernhard

>Index: sys/dev/cardbus/cardbus_cis.c
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>--- 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 !=3D 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
> 	}
> }
>=20
>Index: sys/dev/pci/pci.c
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>--- 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;
>=20
>+	/*
>+	 * The BAR may already exist if the device is a CardBus card
>+	 * whose CIS is stored in this BAR.
>+	 */
>+	pm =3D pci_find_bar(dev, reg);
>+	if (pm !=3D NULL) {
>+		maprange =3D pci_maprange(pm->pm_value);
>+		barlen =3D maprange =3D=3D 64 ? 2 : 1;
>+		return (barlen);
>+	}
>+
> 	pci_read_bar(dev, reg, &map, &testval);
> 	if (PCI_BAR_MEM(map)) {
> 		type =3D SYS_RES_MEMORY;
Hi Bernhard,

Your patch worked a charm (I only had to patch pci.c though, the cardbus
modifications looked unncessary.)

Thanks!

richo

--=20
richo || Today's excuse:=20

somebody was calculating pi on the server

--J2SCkAp4GZ/dPZZf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJNyH45AAoJEIKiWz6J5yQVLzgH/RQ09jlLxcYH8tx1rYveLn4f
+GLnTXrZ/h8ZEBz/QNPgvQebraPc0Rh+7dP3foPJvIbc+N7gZMg17efMl7/V54pe
gg5c9Fn7/xbCug7Ou+EtkAuX+T4ReHnoqtNqxe2pVGJWQ7v8pIWxCTlHBDMvCQmf
dy1q0g/5GJe4MQQzXfEDkXtF0aPW7WW5HNXGWKiftOca06uPEJb+4PJp1J62EdDV
qyxh6djruWMgCzlftYPudEDNFGIt2ah209Xu2quCW8qcFeZZAjYsAyN1tsmgJzw6
Tn5GWzpkeS0Q6pFCFl1RPcCL+S0gIhSAaTvpQSRoe7noj3tkmj2yAKLlmA8hUb0=
=5DGL
-----END PGP SIGNATURE-----

--J2SCkAp4GZ/dPZZf--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110509235225.GA19432>