diff options
author | Liav A <liavalb@gmail.com> | 2021-03-19 21:05:47 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-21 13:41:09 +0100 |
commit | 6440beeffe9e6d06002a75ef91419d7c8b7ccf8f (patch) | |
tree | eeb081968de64ccb3c5bc67e629e8af6056cb10f /Kernel/Storage/AHCIPort.cpp | |
parent | 2ae9de77bb3ff877d87ba69691b490b2846b979b (diff) | |
download | serenity-6440beeffe9e6d06002a75ef91419d7c8b7ccf8f.zip |
Kernel/AHCI: Shift the call to reset() for the WorkQueue
Diffstat (limited to 'Kernel/Storage/AHCIPort.cpp')
-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)) { |