[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cdi-devel] [PATCH 4/5] e1000: Acknowledge interrupts explicitly by ICR write

The old e1000 models used to clear the interrupt flags in ICR on read,
but e1000e doesn't do this any more. Just writing the bits back is fine
for both, so let's do just that.

Clearing the bits must be done before actually processing the interrupt
in order to avoid races with new events.

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
 e1000/device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/e1000/device.c b/e1000/device.c
index cf5bc81..49f1553 100644
--- a/e1000/device.c
+++ b/e1000/device.c
@@ -584,6 +584,7 @@ static void e1000_handle_interrupt(struct cdi_device* device)
     struct e1000_device* netcard = (struct e1000_device*) device;
     uint32_t icr = reg_inl(netcard, REG_INTR_CAUSE);
+    reg_outl(netcard, REG_INTR_CAUSE, icr);
 #ifdef DEBUG
     printf("e1000: Interrupt, ICR = %08x\n", icr);