1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

Kernel/AHCI: Shift the call to reset() for the WorkQueue

This commit is contained in:
Liav A 2021-03-19 21:05:47 +02:00 committed by Andreas Kling
parent 2ae9de77bb
commit 6440beeffe

View file

@ -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)) {