Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2005 10:21:12 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-alpha@freebsd.org, ticso@cicely.de
Subject:   Re: Panic in tulip_txprobe
Message-ID:  <200512211021.13384.jhb@freebsd.org>
In-Reply-To: <20051221020726.GV83393@cicely12.cicely.de>
References:  <20051221020726.GV83393@cicely12.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <PCI bus> on pcib0
> pcib1: <PCI-PCI bridge> at device 8.0 on pci0
> pci1: <PCI bus> on pcib1
> de0: <Digital 21040 Ethernet> 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>  <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 <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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