1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:47:47 +00:00

Kernel: Don't wait for AHCI port to reset the signature

Instead of waiting for the AHCI HBA to reset the signature after SATA
reset sequence, let's just check if the Port x Serial ATA Status
register was set to value 3, indicating that device was detected
and phy communication was established.
This commit is contained in:
Liav A 2021-03-12 18:27:38 +02:00 committed by Andreas Kling
parent 2929dc6bd7
commit a93dc8c8c9

View file

@ -632,22 +632,11 @@ bool AHCIPort::initiate_sata_reset()
retry++;
}
// If device presence detected and Phy communication established, wait for signature to update
if ((m_port_registers.ssts & 0xf) == 3) {
retry = 0;
while (retry < 30000) {
if (!(m_port_registers.tfd & (ATA_SR_BSY | ATA_SR_DRQ)) && m_port_registers.sig != 0xffffffff)
break;
IO::delay(10);
retry++;
}
}
dmesgln("AHCI Port {}: {}", representative_port_index(), try_disambiguate_sata_status());
full_memory_barrier();
clear_sata_error_register();
return m_port_registers.sig != AHCI::DeviceSignature::Unconnected;
return (m_port_registers.ssts & 0xf) == 3;
}
void AHCIPort::set_interface_state(AHCI::DeviceDetectionInitialization requested_action)