From owner-freebsd-alpha@FreeBSD.ORG Wed Dec 21 15:21:42 2005 Return-Path: X-Original-To: freebsd-alpha@freebsd.org Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD0B216A41F; Wed, 21 Dec 2005 15:21:42 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFD6043D5D; Wed, 21 Dec 2005 15:21:41 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4291884 for multiple; Wed, 21 Dec 2005 10:23:18 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBLFLc6q014803; Wed, 21 Dec 2005 10:21:39 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-alpha@freebsd.org, ticso@cicely.de Date: Wed, 21 Dec 2005 10:21:12 -0500 User-Agent: KMail/1.8.2 References: <20051221020726.GV83393@cicely12.cicely.de> In-Reply-To: <20051221020726.GV83393@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512211021.13384.jhb@freebsd.org> X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: Panic in tulip_txprobe X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 15:21:43 -0000 On Tuesday 20 December 2005 09:07 pm, Bernd Walter wrote: > Recent -current. > September -current worked fine. > > FreeBSD/alpha SRM disk boot, Revision 1.2 > (ticso@cicely4.cicely.de, Tue Dec 20 14:18:06 CET 2005) > Memory: 655360 k > Loading /boot/defaults/loader.conf > /boot/kernel/kernel data=0x384220+0x1d8c0 syms=[0x8+0x49a40+0x8+0x3ded8] > > Hit [Enter] to boot immediately, or any other key for command prompt. > Booting [/boot/kernel/kernel]... > Entering /boot/kernel/kernel at 0xfffffc000033bfa0... > KDB: debugger backends: ddb > KDB: current backend: ddb > Copyright (c) 1992-2005 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD 7.0-CURRENT #0: Tue Dec 20 22:41:07 CET 2005 > > ticso@cicely4.cicely.de:/usr/obj/var/d21/builder/c4-2005-12-20/src/sys/CICE >LY4 AlphaStation 500 or 600 (KN20AA) > Digital AlphaStation 600 5/266, 266MHz > 8192 byte page size, 1 processor. > CPU: EV5 (21164) major=5 minor=0 > OSF PAL rev: 0x1000000020116 > real memory = 668778496 (637 MB) > avail memory = 648364032 (618 MB) > cia0: <2117x Core Logic chipset> > cia0: ALCOR/ALCOR2, pass 2 > pcib0: <2117x PCI host bus adapter> on cia0 > pci0: on pcib0 > pcib1: at device 8.0 on pci0 > pci1: on pcib1 > de0: mem 0x80222000-0x8022207f irq 16 at device > 0.0 on pci1 de0: DEC 21040 [10Mb/s] pass 2.3 > > fatal kernel trap: > > trap entry = 0x2 (memory management fault) > cpuid = 0 > faulting va = 0x0 > type = access violation > cause = load instructon > pc = 0xfffffc000053e7c8 > ra = 0xfffffc000053e7ac > sp = 0xfffffc00007318a0 > usp = 0x0 > curthread = 0xfffffc00006896d8 > pid = 0, comm = swapper > > [thread pid 0 tid 0 ] > Stopped at tulip_txprobe+0x68: ldq t0,0(t0) <0x0> > db> trace > Tracing pid 0 tid 0 td 0xfffffc00006896d8 > tulip_txprobe() at tulip_txprobe+0x68 > tulip_media_poll() at tulip_media_poll+0x488 > tulip_media_select() at tulip_media_select+0x104 > tulip_reset() at tulip_reset+0x32c > tulip_attach() at tulip_attach+0x1e4 > tulip_pci_attach() at tulip_pci_attach+0xc74 This is more fallout from Ruslan's IF_LLADDR changes. The simplest fix would be to change tulip_txprobe() to use sc->tulip_enaddr rather than IF_LLADDR prior to the call to ether_ifattach(). Hmmm, tulip_addr_filter() can also be called from tulip_init_locked() via tulip_linkup() via tulip_media_poll() as well. *sigh* I hate to call ether_ifattach() before the chip is actually known to be in a working state though which is the other alternative. You can try this patch which uses sc->tulip_enaddr early on: Index: if_de.c =================================================================== RCS file: /usr/cvs/src/sys/pci/if_de.c,v retrieving revision 1.177 diff -u -r1.177 if_de.c --- if_de.c 1 Dec 2005 21:18:04 -0000 1.177 +++ if_de.c 21 Dec 2005 15:15:33 -0000 @@ -246,6 +246,8 @@ tulip_txprobe(tulip_softc_t * const sc) { struct mbuf *m; + u_char *enaddr; + /* * Before we are sure this is the right media we need * to send a small packet to make sure there's carrier. @@ -260,8 +262,12 @@ /* * Construct a LLC TEST message which will point to ourselves. */ - bcopy(IF_LLADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_dhost, 6); - bcopy(IF_LLADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_shost, 6); + if (sc->tulip_ifp->if_input != NULL) + enaddr = IF_LLADDR(sc->tulip_ifp); + else + enaddr = sc->tulip_enaddr; + bcopy(enaddr, mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN); + bcopy(enaddr, mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN); mtod(m, struct ether_header *)->ether_type = htons(3); mtod(m, unsigned char *)[14] = 0; mtod(m, unsigned char *)[15] = 0; @@ -3041,7 +3047,10 @@ IF_ADDR_LOCK(ifp); /* Copy MAC address on stack to align. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); + if (ifp->if_input != NULL) + bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); + else + bcopy(sc->tulip_enaddr, eaddr, ETHER_ADDR_LEN); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org