Subject: Re: Problem with INTEL NIC on AXPPCI33
To: Pierre-Emmanuel Brinette <brinette@hrnet.fr>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-alpha
Date: 08/24/2003 21:05:52
> [...]
> fxp0 at pci0 dev 12 function 0: i82558 Ethernet, rev 5
> fxp0: interrupting at isa irq 9
> 
> CPU 0: fatal kernel trap:
> 
> CPU 0    trap entry = 0x2 (memory management fault)
> CPU 0    a0         = 0x118
> CPU 0    a1         = 0x1
> CPU 0    a2         = 0x1
> CPU 0    pc         = 0xfffffc00006d48bc
> CPU 0    ra         = 0xfffffc00003c5240
> CPU 0    pv         = 0xfffffc00006d48a0
> CPU 0    curproc    = 0xfffffc0000941928
> CPU 0        pid = 0, comm = swapper
> 
> panic: trap
> Stopped in pid 0 (swapper) at   cpu_Debugger+0x4:       ret     zero,(ra)
> db> tr
> cpu_Debugger() at cpu_Debugger+0x4
> panic() at panic+0x168
> trap() at trap+0x5f4
> XentMM() at XentMM+0x20
> --- memory management fault (from ipl 6) ---
> lca_mem_write_4() at lca_mem_write_4+0x1c

This is pci_swiz_bus_mem_chipdep.c:1197
1192                    tmpmemh = memh + off;
1193                    offset = tmpmemh & 3;
1194                    nval = val /*<< (8 * offset)*/;
1195                    port = (u_int32_t *)((tmpmemh << CHIP_ADDR_SHIFT) |
1196                        (3 << CHIP_SIZE_SHIFT));
1197                    *port = nval;
1198            }
1199            alpha_mb();
1200    }

> fxp_get_info() at fxp_get_info+0x40

This is:
	CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET);

So the kernel bombs at the first access to the fxp memory-mapped registers.

Maybe try to change fxp_pci_attach() to use IO mapping instead if possible
(in fxp_pci_attach(), just revert the memh_valid and ioh_valid tests,
to test ioh_valid first)

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--