Kernel: Fix E1000 driver interrupts

I have no idea why, but E1000 seems to be missing interrupts frequently
when clearing ICR only at the end of the interrupt handler
This commit is contained in:
Bananymous 2025-06-06 03:45:35 +03:00
parent 73090ecb37
commit 96d5ed9cc7
1 changed files with 3 additions and 3 deletions

View File

@ -292,8 +292,10 @@ namespace Kernel
void E1000::handle_irq()
{
if (!(read32(REG_ICR) & (ICR_RxQ0 | ICR_RXT0)))
const uint32_t icr = read32(REG_ICR);
if (!(icr & (ICR_RxQ0 | ICR_RXT0)))
return;
write32(REG_ICR, icr);
SpinLockGuard _(m_lock);
@ -315,8 +317,6 @@ namespace Kernel
descriptor.status = 0;
write32(REG_RDT0, rx_current);
}
write32(REG_ICR, 0xFFFFFFFF);
}
}