Subject: Re: sip*: reset in interrupt logic
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: tech-net
Date: 08/05/2002 10:09:42
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1134.1028509773.1@itojun.org>
>So, the things that call sip_init() from within sip_intr() are:
> * Transmit FIFO underrun
> * PCI parity error
> * PCI system error
> * PCI master abort
> * PCI target abort
> * Receive status FIFO overrun
>A message will be displayed on the console indicating which error it is.
with my Net4501, it hangs up before the above message is printed.
here's the printf trace - looks to me some interrupt source is not
cleared (not sure why NOT calling sip_reset() solves the problem).
btw, what is the baudrate of serial console for Net4501? i see garbage
on the reboot.
itojun
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1134.1028509773.2@itojun.org>
Script started on Mon Aug 5 10:04:02 2002
itojun[starfruit:/home/itojun] tip tty00
connected
tiny#
tiny# dmesg
NetBSD 1.6E (GENERIC) #2: Mon Aug 5 09:56:21 JST 2002
itojun@starfruit.itojun.rrg:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC
cpu0: AMD Am5x86 W/B 133/160 (486cclass)
cpu0: features 1<FPU>
total memory = 65148 KB
avail memory = 53948 KB
using 839 buffrrs containing 3356 KB of memory
RTC BIOS diagnostic error 40<ROM_cksum>
BIOS32 rev. 0 found at 0xf00c0
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Advanced Micro Devices Elan SC520 System Controller (rev. 0x00)
sip0 at pci0 dev 18 function 0: NatSemi DP83815 10/100 Ethernet, rev 00
sip0: interrupting at irq 10
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
sip0: Ethernet address 00:00:24:c0:55:dc
nsphyter0 at sip0 phy 0: DP83815 10/100 media interface, rev. 1
nsphyter0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sip1 at pci0 dev 19 function 0: NatSemi DP83815 10/100 Ethernet, rev 00
sip1: interrupting at irq 11
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
sip1: Ethernet address 00:00:24:c0:55:dd
nsphyter1 at sip1 phy 0: DP83815 10/100 media interface, rev. 1
nsphyter1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at mainbus0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, woriing fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
kbc selftest: ffffffff
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 channel 0 drive 0: <SunDisk SDCFB-96>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 93952 KB, 734 cyl, 8 head, 32 sec, 512 bytes/sect x 187904 sectors
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
isapnp0: no ISA Plug 'n Play devices found
biomask f3e7 netmask ffe7 ttymask ffe7
Kernelized RAIDframe activated
boot device: wd0
root on wd0a dumps on wd0b
WARNING: clock time much less than file system time
WARNING: using file system time
WARNING: CHECK AND RESET THE DATE!
root file system type: ffs
tiny# ifconfig sip0 up
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2154
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2140
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2146
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2093
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2099
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2106
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../../dev/pci/if_sip.c 2110
/home/itojun/NetBSD/src/sys/arch/i386/compile/GENERIC/../../../.~pcStopped in pid 190 (ifconfig) at cpu_Debugger+0x4: leave
db> reboot
syncing disks... 5 5 4 2 done
rebooting...
Script done on Mon Aug 5 10:04:27 2002
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1134.1028509773.3@itojun.org>
Index: if_sip.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/if_sip.c,v
retrieving revision 1.61
diff -u -r1.61 if_sip.c
--- if_sip.c 2002/07/11 18:07:56 1.61
+++ if_sip.c 2002/08/05 01:08:11
@@ -2090,20 +2090,24 @@
bus_space_handle_t sh = sc->sc_sh;
int i;
+printf("%s %d\n", __FILE__, __LINE__);
bus_space_write_4(st, sh, SIP_IER, 0);
bus_space_write_4(st, sh, SIP_IMR, 0);
bus_space_write_4(st, sh, SIP_RFCR, 0);
bus_space_write_4(st, sh, SIP_CR, CR_RST);
+printf("%s %d\n", __FILE__, __LINE__);
for (i = 0; i < SIP_TIMEOUT; i++) {
if ((bus_space_read_4(st, sh, SIP_CR) & CR_RST) == 0)
break;
delay(2);
}
+printf("%s %d\n", __FILE__, __LINE__);
if (i == SIP_TIMEOUT)
printf("%s: reset failed to complete\n", sc->sc_dev.dv_xname);
+printf("%s %d\n", __FILE__, __LINE__);
delay(1000);
#ifdef DP83820
@@ -2133,16 +2137,21 @@
u_int32_t reg;
int i, error = 0;
+printf("%s %d\n", __FILE__, __LINE__);
/*
* Cancel any pending I/O.
*/
SIP_DECL(stop)(ifp, 0);
+printf("%s %d\n", __FILE__, __LINE__);
+#if 1
/*
* Reset the chip to a known state.
*/
SIP_DECL(reset)(sc);
+#endif
+printf("%s %d\n", __FILE__, __LINE__);
#if !defined(DP83820)
if (SIP_CHIP_MODEL(sc, PCI_VENDOR_NS, PCI_PRODUCT_NS_DP83815)) {
/*
------- =_aaaaaaaaaa0--