diff options
-rw-r--r-- | Kernel/Storage/AHCIPort.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/Storage/AHCIPort.cpp b/Kernel/Storage/AHCIPort.cpp index d0e01bfe16..81104e2a2e 100644 --- a/Kernel/Storage/AHCIPort.cpp +++ b/Kernel/Storage/AHCIPort.cpp @@ -102,7 +102,11 @@ void AHCIPort::handle_interrupt() m_wait_connect_for_completion = true; } if (m_interrupt_status.is_set(AHCI::PortInterruptFlag::INF)) { - reset(); + // We need to defer the reset, because we can receive interrupts when + // resetting the device. + g_io_work->queue([this]() { + reset(); + }); return; } if (m_interrupt_status.is_set(AHCI::PortInterruptFlag::IF) || m_interrupt_status.is_set(AHCI::PortInterruptFlag::TFE) || m_interrupt_status.is_set(AHCI::PortInterruptFlag::HBD) || m_interrupt_status.is_set(AHCI::PortInterruptFlag::HBF)) { |