From nobody Sat May 18 16:46:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95344+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95344+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1666108504; cv=none; d=zohomail.com; s=zohoarc; b=HnIpTE7QUmUP0YcRtniwn7b3AwS1wR0ELo4mR+1O7Vr4p39Oas4BzZhfy3EmQExZR5+GgQ5Ez83jIUMTX3vZjeTl5gIcqVL+aj2WckhjeiIl8bP1gl4HDcP0Fc4ImAGiQdfudIaYNXG28i8rRX8yM5MnGeeB5rkkwckocGcpq6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666108504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=973KFnL5MSXutsLjlzxpWF4wUeRSs/8N8YJmjJOPKm0=; b=IXdwsSYF0TFySiyoKbTggPW7Yg4L1KV7n5uCaaBUCaMJQdTXSJGMuUvUxiFK8sM5+SRBWa7XO+ULSmE7OexZBDFPtqIOZL1CYHcZJ0OCFz8lPEe9Ev6+8S+UYtW7CcaEO/mCwi8Jb87nw06Tf0X5sSwvVkaLcsg48jBYfj/zKGI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95344+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1666108504189760.5056868790116; Tue, 18 Oct 2022 08:55:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rQd6YY1788612xzBpLBiH6iz; Tue, 18 Oct 2022 08:55:03 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.8828.1666108502999273708 for ; Tue, 18 Oct 2022 08:55:03 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="286540358" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="286540358" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 08:54:57 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="606607077" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="606607077" X-Received: from malbecki-mobl.ger.corp.intel.com ([10.252.43.77]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 08:54:55 -0700 From: "Albecki, Mateusz" To: devel@edk2.groups.io Cc: Mateusz Albecki , Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting Date: Tue, 18 Oct 2022 17:54:19 +0200 Message-Id: <20221018155419.2808-2-mateusz.albecki@intel.com> In-Reply-To: <20221018155419.2808-1-mateusz.albecki@intel.com> References: <20221018155419.2808-1-mateusz.albecki@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mateusz.albecki@intel.com X-Gm-Message-State: JyJuzOefkHtEyYsexUbmRnkYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666108503; bh=4nYO0X0HCJz2f4eIb7JsdNlwt2Jwb/7Gqvcfat8ZkDg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qoPsYb2sSnTPEBQRWxLLeZtEhaoJHPo9u329zS6nnigbbWxJV4rmB6n7VEV2PIFaPXg Yj8XV+zTSGZRPIEfrPoqwEd45wRcdapEqpNCjmO4m+M1UcRdfAArK+HooiVzZTn+Ghv/E 7UfD8xomblno8Xr8yhQxMAzFmhFTB/3KE+I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666108505273100002 Content-Type: text/plain; charset="utf-8" Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4016 AtaAtapiPassThru driver was reporting recovery status on failed command packets which led to incorrect flows in upper layers and to SCT tests fails. This commit will change the logic to report command status. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Mateusz Albecki --- .../Bus/Ata/AtaAtapiPassThru/AhciMode.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.c index a240be940d..06c4a3e052 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -949,6 +949,7 @@ AhciPioTransfer ( EFI_AHCI_COMMAND_LIST CmdList; UINT32 PrdCount; UINT32 Retry; + EFI_STATUS RecoveryStatus; =20 if (Read) { Flag =3D EfiPciIoOperationBusMasterWrite; @@ -1026,8 +1027,8 @@ AhciPioTransfer ( =20 if (Status =3D=3D EFI_DEVICE_ERROR) { DEBUG ((DEBUG_ERROR, "PIO command failed at retry %d\n", Retry)); - Status =3D AhciRecoverPortError (PciIo, Port); - if (EFI_ERROR (Status)) { + RecoveryStatus =3D AhciRecoverPortError (PciIo, Port); + if (EFI_ERROR (RecoveryStatus)) { break; } } else { @@ -1122,6 +1123,7 @@ AhciDmaTransfer ( EFI_PCI_IO_PROTOCOL *PciIo; EFI_TPL OldTpl; UINT32 Retry; + EFI_STATUS RecoveryStatus; =20 Map =3D NULL; PciIo =3D Instance->PciIo; @@ -1220,8 +1222,8 @@ AhciDmaTransfer ( Status =3D AhciWaitUntilFisReceived (PciIo, Port, Timeout, SataFisD2= H); if (Status =3D=3D EFI_DEVICE_ERROR) { DEBUG ((DEBUG_ERROR, "DMA command failed at retry: %d\n", Retry)); - Status =3D AhciRecoverPortError (PciIo, Port); - if (EFI_ERROR (Status)) { + RecoveryStatus =3D AhciRecoverPortError (PciIo, Port); + if (EFI_ERROR (RecoveryStatus)) { break; } } else { @@ -1261,14 +1263,14 @@ AhciDmaTransfer ( Status =3D AhciCheckFisReceived (PciIo, Port, SataFisD2H); if (Status =3D=3D EFI_DEVICE_ERROR) { DEBUG ((DEBUG_ERROR, "DMA command failed at retry: %d\n", Task->Re= tryTimes)); - Status =3D AhciRecoverPortError (PciIo, Port); + RecoveryStatus =3D AhciRecoverPortError (PciIo, Port); // // If recovery passed mark the Task as not started and change the = status // to EFI_NOT_READY. This will make the higher level call this fun= ction again // and on next call the command will be re-issued due to IsStart b= eing FALSE. // This also makes the next condition decrement the RetryTimes. // - if (Status =3D=3D EFI_SUCCESS) { + if (RecoveryStatus =3D=3D EFI_SUCCESS) { Task->IsStart =3D FALSE; Status =3D EFI_NOT_READY; } @@ -1375,6 +1377,7 @@ AhciNonDataTransfer ( EFI_AHCI_COMMAND_FIS CFis; EFI_AHCI_COMMAND_LIST CmdList; UINT32 Retry; + EFI_STATUS RecoveryStatus; =20 // // Package read needed @@ -1415,8 +1418,8 @@ AhciNonDataTransfer ( Status =3D AhciWaitUntilFisReceived (PciIo, Port, Timeout, SataFisD2H); if (Status =3D=3D EFI_DEVICE_ERROR) { DEBUG ((DEBUG_ERROR, "Non data transfer failed at retry %d\n", Retry= )); - Status =3D AhciRecoverPortError (PciIo, Port); - if (EFI_ERROR (Status)) { + RecoveryStatus =3D AhciRecoverPortError (PciIo, Port); + if (EFI_ERROR (RecoveryStatus)) { break; } } else { --=20 2.28.0.windows.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95344): https://edk2.groups.io/g/devel/message/95344 Mute This Topic: https://groups.io/mt/94411389/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-