From owner-freebsd-current@FreeBSD.ORG Sun Jul 10 00:04:01 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F39F106566B; Sun, 10 Jul 2011 00:04:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC388FC16; Sun, 10 Jul 2011 00:04:01 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p6A028KC010589 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sat, 9 Jul 2011 18:02:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201107080919.58210.jhb@freebsd.org> Date: Sat, 9 Jul 2011 18:02:12 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7CC3B2A2-C372-4E11-9782-19691FD58850@bsdimp.com> References: <4E100086.7080105@FreeBSD.org> <201107071720.50203.jhb@freebsd.org> <4E16C463.9020604@FreeBSD.org> <201107080919.58210.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sat, 09 Jul 2011 18:02:09 -0600 (MDT) Cc: freebsd-current@FreeBSD.org, Doug Barton Subject: Re: cardbus panic: end address is not aligned 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: Sun, 10 Jul 2011 00:04:01 -0000 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