Exception After Enabling Device Interrupts On CEPC



Hi,

We are developing a device driver for a PCI ethernet device. The device
has two interrupts: interrupt A can be read from the registers of the
device, also it is driven through the PCI bus by the device but when
interrupt B occurs, it does not appear in the PCI bus, just must be
handled by accessing the device registers.
In order to handle interrupts, we developed a thread which works in
polling mode and periodically reads the interrupt registers of the
device, call additional functions if any interrupts occur.
After the operating system initialization phase, everything seems to be
fine but when an interrupt occurs (e.g. when a network cable is
connected to the device), the system crashes, some programs seems to be
entered to an endless loop. Here is the part that repeats on the output
screen :

.....
4294905984 PID:6f676fbe TID:cf451f96 0849fc34
4294905984 PID:6f676fbe TID:cf451f96 802a3619
4294905984 PID:6f676fbe TID:cf451f96 0000300e
4294905984 PID:6f676fbe TID:cf451f96 802a8f41
4294905985 PID:6f676fbe TID:cf451f96
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Exception 00d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905985 PID:6f676fbe TID:cf451f96 Fatal Stack Error, Terminating
thread 8f44e800
4294905998 PID:6f676fbe TID:cf451f96 Exception 0d Thread=8f44e800
Proc=6f676fbe 'device.exe'
4294905998 PID:6f676fbe TID:cf451f96 EIP=802aeb37 AKY=00000009
Flags=00010002 EA=00000000
4294905998 PID:6f676fbe TID:cf451f96 Eax=0849fc68 Ebx=0849ff84
Ecx=00000000 Edx=0000300e
4294905998 PID:6f676fbe TID:cf451f96 Esi=8023dd30 Edi=82c379dc
Ebp=0849fc1c Esp=0849fc1c
4294905999 PID:6f676fbe TID:cf451f96 CS=0019 DS=0040 ES=84a0040 SS=0021
FS=80240060 GS=84a0000
4294905999 PID:6f676fbe TID:cf451f96 Dumping 4 dwords
4294905999 PID:6f676fbe TID:cf451f96
0849fc1c -
.....


It is really strange that I could not find the thread which causes
exception with Remote Process Viewer (ID = 8f44e800 for this execution)
I also connected to the CEPC through serial connection with
Hyperterminal during another execution and got the following output:

.....

Unhandled exception c0000005:
Exception 0e Thread=8f3a9968 AKY=ffffffff EIP=80253ef9
Eax=8f3a9968 Ebx=0852fa84 Ecx=00000005 Edx=00000004
Esi=8023dd30 Edi=82c4172c Ebp=0852f9b4 Esp=0852f978
CS=0019 DS=0040 ES=0040 SS=0021 FS=0060 GS=0000
Flags=00003246
Halting system

.....


After that, I have changed the sequence and caused the device to
produce an interrupt during the initialization of the operating system.
Then the system crashed at the begining. Here is the output for that:


+KITLRegisterDfltClient, service:0
+KITLRegisterDfltClient, service:1
KITLGlobalState == 0x61
Waiting for service 'DBGMSG' to connect..., fUseSy

ProcessAdminMsg: Receive Config message for service DBGMSG

ProcessAdminMsg: Receive Config message for service PPSH

ProcessAdminMsg: Receive Config message for service DBGMSG

ProcessAdminMsg: Receive Config message for service DBGMSG

ProcessAdminMsg: Receive Config message for service PPSH

+KITLRegisterDfltClient, service:2
ProcessAdminMsg: Receive Config message for service KDBG

ProcessAdminMsg: Receive Config message for service KDBG

MarshalProcessesAsModules: Process ID 0x0F6DF002 (NK.EXE) not using
CoreDl

l, may be in startup or shutdown.
MarshalProcessesAsModules: Process ID 0x0F6DF002 (NK.EXE) not using
CoreDll.dl

l, may be in startup or shutdown.
MarshalProcessesAsModules: Process ID 0x0F6DF002 (NK.EXE) not using
CoreDll.dl

l, may be in startup or shutdown.
GetProcessDebugInfo: Process ID 0x0F6DF002 (NK.EXE) not using
CoreDll.dll, may

be in startup or shutdown.
KITL: Leaving polling mode...
KITL Checking client registrations
+RegisterClientPart2: Id 0x00000000
KITL Timer thread started, (hTh: 0x2F6DBF96

-RegisterClientPart2
+RegisterClientPart2: Id 0x00000001
-RegisterClientPart2
KITL Creating IST
KITL Interrupt thread started (hTh: 0x6F6D0F9E, pTh: 0x8F6CE800), using
SYSINTR

21
Enabling adapter ints...
+EDBG:D3C90XEnableInts
-EDBG:D3C90XEnableInts
VBridge:: VB_INITIALIZED returns [1]

VBridge:: RESET_BUFFER received.
VBridge:: built on [Dec 19 2005] time [18:05:27]

VBridgeInit()...TX = [16384] bytes -- Rx = [16384] bytes

Tx buffer [0xA2C351E0] to [0xA2C391E0].

Rx buffer [0xA2C39200] to [0xA2C3D200].

+EDBG:D390XCurrentPacketFilter - 0000000B

-EDBG:D390XCurrentPacketFilter
VBridge:: Current VMini packet filter = [0xB]

+EDBG:D390XMulticastList - 2
-EDBG:D390XMulticastList
0x8f3c18a8: Exception 00e Thread=8f3c18a8 Proc=af3cf802 'services.exe'

0x8f3c18a8: AKY=ffffffff PC=802a8bd5(NK.EXE+0x00088bd5) ESP=0e03e51c
EA=00000000


0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)

.. This OK if KdStub stumbling on its own BP.

KdTrap: Exception in debugger, Addr=0x802A8BD5 - attempting to

0x8f3c18a8: SERVICES!RegisterService fails, GLE=0x00000057

0x8f3c18a8: >>> Loading module ole32.dll at address
0x033F0000-0x03429000 (RW da

ta at 0x01F10000-0x01F11520)
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)

.. This OK if KdStub stumbling on its own BP.

KdTrap: Exception in debugger, Addr=0x80260143 - attempting to
recover

0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)

.. This OK if KdStub stumbling on its own BP.

KdTrap: Exception in debugger, Addr=0x80260143 - unable to recover

0x8f3c18a8: >>> Loading module obexsrvr.dll at address
0x02660000-0x02677000 (RW
data at 0x01EB9000-0x01EB95EC)
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - attempting to
recover
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - unable to recover
0x8f3c18a8: >>> Loading module timesvc.dll at address
0x02650000-0x02657000 (RW
data at 0x01EB7000-0x01EB7564)
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - attempting to
recover
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - unable to recover
0x8f3c18a8: <<< Unloading module regenum.dll at address
0x03F20000-0x03F25000 (R
W data at 0x01FFA000-0x01FFA4AC)
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - attempting to
recover
0x8f3c18a8: Recursively calling KDEnableInt(FALSE, psvdThread != NULL)
1 time(s)
.. This OK if KdStub stumbling on its own BP.
KdTrap: Exception in debugger, Addr=0x80260143 - unable to recover


I loaded an ISR to handle the interrupts from PCI with
LoadIntChainHandler and KernelLibIoControl. I have got the interrupt
from the PCI bus until the system craches and after that, I have tried
Interrupt B which is not produced through the PCI bus. Reasonably, my
ISR is not called but the system crashed again.

I wonder if the problem is related with the device interrupts which
causes another thread to crash. Does anyone has any idea??

.


Loading