summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-03-12 18:27:38 +0200
committerAndreas Kling <kling@serenityos.org>2021-03-13 09:52:31 +0100
commita93dc8c8c949a6e97ba5a77eb537a6712b9d9b86 (patch)
tree544cbcafb074486ac80b3579965c865ab0cb5ca6
parent2929dc6bd7d699b138aad9773d5c13564e985f35 (diff)
downloadserenity-a93dc8c8c949a6e97ba5a77eb537a6712b9d9b86.zip
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.
-rw-r--r--Kernel/Storage/AHCIPort.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/Kernel/Storage/AHCIPort.cpp b/Kernel/Storage/AHCIPort.cpp
index de0707e9e7..91d7241a04 100644
--- a/Kernel/Storage/AHCIPort.cpp
+++ b/Kernel/Storage/AHCIPort.cpp
@@ -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)