mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +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:
parent
2929dc6bd7
commit
a93dc8c8c9
1 changed files with 1 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue