From 83b0d9ab61c96570f3316ffa4f8df388cac3b6b6 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Thu, 11 Jan 2024 15:09:41 -0800 Subject: [PATCH] [Denali] Minor AHCI fixes --- sys/denali/ahci/ahci_port.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/denali/ahci/ahci_port.cpp b/sys/denali/ahci/ahci_port.cpp index 888b714..21c0501 100644 --- a/sys/denali/ahci/ahci_port.cpp +++ b/sys/denali/ahci/ahci_port.cpp @@ -128,7 +128,7 @@ glcr::ErrorOr AhciPort::IssueCommand( command_list_->command_headers[slot].prd_table_length = 1; command_list_->command_headers[slot].command = - (sizeof(HostToDeviceRegisterFis) / 2) & 0x1F; + (sizeof(HostToDeviceRegisterFis) / 4) & 0x1F; // Set prefetch bit. command_list_->command_headers[slot].command |= (1 << 7); @@ -171,7 +171,8 @@ void AhciPort::HandleIrq() { if (!CheckFisType(FIS_TYPE_REG_D2H, fis.fis_type)) { return; } - if (fis.error) { + // Check is init to avoid showing an error from the COMRESET operation. + if (fis.error && is_init_) { dbgln("D2H err: {x}", fis.error); dbgln("status: {x}", fis.status);