Subject: Re: Kernel panics with pci network cards (fxp and ex)
To: Einar Karttunen <ekarttun@cs.helsinki.fi>
From: Martin Husemann <martin@duskware.de>
List: port-alpha
Date: 05/23/2004 17:49:39
On Sun, May 23, 2004 at 04:14:56PM +0300, Einar Karttunen wrote:
> -- memory management fault (from ipl6) ---
> apecs_memwrite_4+0x30
> fxp_get_info+0x44
> fxp_attach+0x284
> fxp_pci_attach+0x410
> 
> So it seems to be related to (unaligned?) probing of PCI
> memory/registers.

I can't see how fxp_get_info would do unaligned accesses - but maybe the
firmware didn't handle the PCI BARs correctly? 

How do you figure the faulting data address on alpha?

Can you apply the (untested) patch below and report the output?

Martin

Index: if_fxp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_fxp_pci.c,v
retrieving revision 1.38
diff -c -u -p -r1.38 if_fxp_pci.c
--- if_fxp_pci.c	28 Apr 2004 04:12:16 -0000	1.38
+++ if_fxp_pci.c	23 May 2004 15:47:58 -0000
@@ -274,7 +274,9 @@ fxp_pci_attach(parent, self, aux)
 	 */
 	ioh_valid = (pci_mapreg_map(pa, FXP_PCI_IOBA,
 	    PCI_MAPREG_TYPE_IO, 0,
-	    &iot, &ioh, NULL, NULL) == 0);
+	    &iot, &ioh, NULL, &size) == 0);
+	if (ioh_valid)
+		printf("ioh_valid, size = %d\n", (int)size);
 
 	/*
 	 * Version 2.1 of the PCI spec, page 196, "Address Maps":
@@ -312,9 +314,11 @@ fxp_pci_attach(parent, self, aux)
 	if (memh_valid) {
 		sc->sc_st = memt;
 		sc->sc_sh = memh;
+		printf("selecting memh, size = %d\n", (int)size);
 	} else if (ioh_valid) {
 		sc->sc_st = iot;
 		sc->sc_sh = ioh;
+		printf("selecting ioh\n");
 	} else {
 		aprint_error(": unable to map device registers\n");
 		return;