From 893d4a41c2d6538ebd4ac2eb303c7b407b30c3c1 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 6 Mar 2020 15:52:44 +0200 Subject: [PATCH] Kernel: Enable IRQs before sending commands to the E1000 adapter This change prevents a race condition, in which case we send a command and we are losing an interrupt. --- Kernel/Net/E1000NetworkAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp index 375d624757..ead4b6bdce 100644 --- a/Kernel/Net/E1000NetworkAdapter.cpp +++ b/Kernel/Net/E1000NetworkAdapter.cpp @@ -377,9 +377,9 @@ void E1000NetworkAdapter::send_raw(const u8* data, size_t length) klog() << "E1000: Using tx descriptor " << tx_current << " (head is at " << in32(REG_TXDESCHEAD) << ")"; #endif tx_current = (tx_current + 1) % number_of_tx_descriptors; - out32(REG_TXDESCTAIL, tx_current); cli(); enable_irq(); + out32(REG_TXDESCTAIL, tx_current); for (;;) { if (descriptor.status) { sti();