Kernel/Storage: Enable interrupts for AHCI ports if PHY is not enabled

This change allows the controller to utilize interrupts even if no
device was connected to a port when we initialize it, so we can support
hotplug events now.
This commit is contained in:
Liav A 2021-05-29 01:22:27 +03:00 committed by Andreas Kling
parent d431e4cd01
commit 907b3dd0f3
Notes: sideshowbarker 2024-07-18 17:13:34 +09:00

View file

@ -241,6 +241,10 @@ bool AHCIPort::initialize(ScopedSpinLock<SpinLock<u8>>& main_lock)
VERIFY(m_lock.is_locked());
dbgln_if(AHCI_DEBUG, "AHCI Port {}: Initialization. Signature = 0x{:08x}", representative_port_index(), static_cast<u32>(m_port_registers.sig));
if (!is_phy_enabled()) {
// Note: If PHY is not enabled, just clear the interrupt status and enable interrupts, in case
// we are going to hotplug a device later.
m_interrupt_status.clear();
m_interrupt_enable.set_all();
dbgln_if(AHCI_DEBUG, "AHCI Port {}: Bailing initialization, Phy is not enabled.", representative_port_index());
return false;
}