Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jul 2011 18:02:12 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org, Doug Barton <dougb@FreeBSD.org>
Subject:   Re: cardbus panic: end address is not aligned
Message-ID:  <7CC3B2A2-C372-4E11-9782-19691FD58850@bsdimp.com>
In-Reply-To: <201107080919.58210.jhb@freebsd.org>
References:  <4E100086.7080105@FreeBSD.org> <201107071720.50203.jhb@freebsd.org> <4E16C463.9020604@FreeBSD.org> <201107080919.58210.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm also interested in this problem too if it is in the CardBus layer.  =
This sounds like a problem with jhb's latest pci resource stuff, since =
that code is shared with CardBus...

Another alternative to crashdups is a serial console :)

I've not seen this, but haven't tried two ATH cards in a laptop in about =
three years...  Chances are really good, however, that it has nothing to =
do with ath, other than the specific sizes and numbers of resources it =
tries to allocate...

Warner

On Jul 8, 2011, at 7:19 AM, John Baldwin wrote:

> On Friday, July 08, 2011 4:48:35 am Doug Barton wrote:
>> On 07/07/2011 14:20, John Baldwin wrote:
>>> On Sunday, July 03, 2011 1:39:18 am Doug Barton wrote:
>>>> I have 2 ath-based pc-card adapters. If I put either one of them in =
the=20
>>>> slot while the system is up, or if I try booting with them in the =
slot,=20
>>>> I get an instant panic. The cards previously worked in -current, =
and=20
>>>> continue to work in 8-stable and windows xp. I don't have any other=20=

>>>> pc-cards to compare with. Full core.txt.0 file is in my home =
directory=20
>>>> on freefall.
>>>>=20
>>>> This problem persists on r223732 but happened to me for the first =
time a=20
>>>> week or 2 ago (haven't had time to report it previously, =
apologies). It=20
>>>> likely originated a while before though, I don't use these cards =
very=20
>>>> often.
>>>>=20
>>>> panic: end address is not aligned
>>>>=20
>>>> #1  0xffffffff80426a8a in kern_reboot (howto=3D260)
>>>>     at /home/svn/head/sys/kern/kern_shutdown.c:430
>>>> #2  0xffffffff80426521 in panic (fmt=3DVariable "fmt" is not =
available.
>>>> )
>>>>     at /home/svn/head/sys/kern/kern_shutdown.c:604
>>>> #3  0xffffffff8032c648 in pcib_grow_window (sc=3D0xfffffe0002603400,
>>>>     w=3D0xfffffe0002603498, type=3D3, start=3D0, end=3D4294967295, =
count=3D65536,=20
>>>> flags=3DVariable "flags" is not available.
>>>=20
>>> The line is here:
>>>=20
>>> 	KASSERT((w->limit & ((1ul << w->step) - 1)) =3D=3D (1ul << =
w->step) - 1,
>>> 	    ("end address is not aligned"));
>>>=20
>>> Can you run kgdb and do 'frame 3' and 'p/x *w'?
>>=20
>> (kgdb) frame 3
>> #3  0xffffffff8032c648 in pcib_grow_window (sc=3D0xfffffe0002603400,
>>    w=3D0xfffffe0002603498, type=3D3, start=3D0, end=3D4294967295, =
count=3D65536,
>> flags=3DVariable "flags" is not available.
>> )
>>    at /home/svn/head/sys/dev/pci/pci_pci.c:1018
>> 1018		KASSERT((w->limit & ((1ul << w->step) - 1)) =3D=3D (1ul =
<< w->step) - 1,
>> (kgdb) p/x *w
>> $1 =3D {base =3D 0x80000000, limit =3D 0x8800ffff, rman =3D {rm_list =
=3D {
>>      tqh_first =3D 0xfffffe0002702a00, tqh_last =3D =
0xfffffe0002702a98},
>>    rm_mtx =3D 0xfffffe00024e20e0, rm_link =3D {tqe_next =3D =
0xfffffe0002603520,
>>      tqe_prev =3D 0xfffffe0002603448}, rm_start =3D 0x0, rm_end =3D =
0xffffffff,
>>    rm_type =3D 0x2, rm_descr =3D 0xfffffe0002608060}, res =3D
>> 0xfffffe0002702b00,
>>  reg =3D 0x20, valid =3D 0x1, mask =3D 0x2, step =3D 0x14, name =3D
>> 0xffffffff8071b77c}
>=20
> Hmm, well that's odd.  It didn't grow it enough it seems.
>=20
>>> Also, can you boot your machine, then do 'sysctl =
debug.bootverbose=3D1', insert=20
>>> the card and record the messages in dmesg when it does?  (You can =
likely get=20
>>> those out of kgdb.)
>>=20
>> The system panics instantly when I insert the cards. Would a verbose
>> dmesg entry from 8.2-stable work? I can do that on the same hardware.
>> If not I can try it on -current and see if anything gets logged.
>=20
> Err, if you can get a crashdump, you can use 'printf "%s", =
msgbufp->msg_ptr'
> in kgdb to output all of dmseg.  You can also use the 'dmesg' command =
against
> a crash dump directly, and if you have crashinfo enabled, the tail of =
the
> core.txt.N file in /var/crash will have the full dmesg in it as well.
>=20
> The real messages I will want to see are in the dmesg.   Also, getting =
the
> output of 'devinfo -r' before you insert the card would also be =
helpful so
> I can see what it is growing from.
>=20
> Actually, forgo all that.  Try this patch:
>=20
> Index: 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
> --- pci_pci.c	(revision 223847)
> +++ pci_pci.c	(working copy)
> @@ -954,7 +954,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pci
> 			if (bootverbose)
> 				printf("\tback candidate range: =
%#lx-%#lx\n",
> 				    start_free, back);
> -			back =3D roundup2(back + 1, w->step) - 1;
> +			back =3D roundup2(back + 1, 1ul << w->step) - 1;
> 			back -=3D rman_get_end(w->res);
> 		} else
> 			back =3D 0;
>=20
> --=20
> John Baldwin
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to =
"freebsd-current-unsubscribe@freebsd.org"
>=20
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7CC3B2A2-C372-4E11-9782-19691FD58850>