Author: cgutman
Date: Fri Oct 23 02:27:00 2009
New Revision: 43693
URL:
http://svn.reactos.org/svn/reactos?rev=43693&view=rev
Log:
- Limit the number of interrupts that are handled per call to MiniportHandleInterrupt to
prevent us from staying at DISPATCH_LEVEL for too long
Modified:
trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h
trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c
trunk/reactos/drivers/network/dd/pcnet/pcnet.c
trunk/reactos/drivers/network/dd/pcnet/pcnet.h
Modified: trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/…
==============================================================================
--- trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h [iso-8859-1] Fri Oct 23
02:27:00 2009
@@ -55,7 +55,8 @@
/* Interrupt Mask Register value */
#define DRIVER_INTERRUPT_MASK IMR_ALLE - IMR_RDCE
-
+/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
+#define INTERRUPT_LIMIT 10
/* Global structures */
Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/…
==============================================================================
--- trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c [iso-8859-1] Fri Oct 23 02:27:00
2009
@@ -1315,6 +1315,7 @@
UCHAR ISRMask;
UCHAR Mask;
PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
+ UINT i = 0;
ISRMask = Adapter->InterruptMask;
NdisRawReadPortUchar(Adapter->IOBase + PG0_ISR, &ISRValue);
@@ -1323,12 +1324,14 @@
Adapter->InterruptStatus |= (ISRValue & ISRMask);
- if (ISRValue != 0x00)
- /* Acknowledge interrupts */
- NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
-
Mask = 0x01;
- while (Adapter->InterruptStatus != 0x00) {
+ while (Adapter->InterruptStatus != 0x00 && i++ < INTERRUPT_LIMIT) {
+
+ if (ISRValue != 0x00) {
+ /* Acknowledge interrupts */
+ NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
+ Mask = 0x01;
+ }
NDIS_DbgPrint(MID_TRACE, ("Adapter->InterruptStatus (0x%X) Mask
(0x%X).\n",
Adapter->InterruptStatus, Mask));
@@ -1409,12 +1412,6 @@
NDIS_DbgPrint(MID_TRACE, ("ISRValue (0x%X).\n", ISRValue));
Adapter->InterruptStatus |= (ISRValue & ISRMask);
-
- if (ISRValue != 0x00) {
- /* Acknowledge interrupts */
- NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
- Mask = 0x01;
- }
}
NICEnableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
Modified: trunk/reactos/drivers/network/dd/pcnet/pcnet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/pcnet/p…
==============================================================================
--- trunk/reactos/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] Fri Oct 23 02:27:00 2009
@@ -66,6 +66,7 @@
{
PADAPTER Adapter = (PADAPTER)MiniportAdapterContext;
USHORT Data;
+ UINT i = 0;
DPRINT("Called\n");
@@ -78,7 +79,7 @@
DPRINT("CSR0 is 0x%x\n", Data);
- while(Data & CSR0_INTR)
+ while((Data & CSR0_INTR) && i++ < INTERRUPT_LIMIT)
{
/* Clear interrupt flags early to avoid race conditions. */
NdisRawWritePortUshort(Adapter->PortOffset + RDP, Data);
Modified: trunk/reactos/drivers/network/dd/pcnet/pcnet.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/pcnet/p…
==============================================================================
--- trunk/reactos/drivers/network/dd/pcnet/pcnet.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/pcnet/pcnet.h [iso-8859-1] Fri Oct 23 02:27:00 2009
@@ -149,6 +149,9 @@
/* flags */
#define RESET_IN_PROGRESS 0x1
+/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
+#define INTERRUPT_LIMIT 10
+
#if DBG
#define BREAKPOINT DbgBreakPoint();
#else