From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.5709.1666319235709973031 for ; Thu, 20 Oct 2022 19:27:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LLmZV0wT; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666319235; x=1697855235; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=Wqm66AWYm/ztt8pObN65LJjWGoxFc1KREYnygZ27jbA=; b=LLmZV0wTcFv77VyeLm1rXS4KPIPLQWVRqBOfDY+lGPhG1iirJ3pofQ73 hF1G9IY/Gbthwe+gMQhJEoWLvBp3/i5Ijluot7+YAvp+F6QakVp+fkeDF 1OTNfxy+1xZMmxNN+GvhaN0zqaW7WxSACSsZ0wSLydAH/d96E9poBiJOY P+gBecueEJ0pUJNO9HgaqeM62J61XRyEPhpfc2G1yMGHu4YtyqdvkOh7V 5253D+Gr2m2KLH7pj4L0DQPIM+9NChNr4z+U/RUMNaf/9bSFTnfMVPQPI pHD28SLG85Q3ypOLnAcjrgCYFUNuMXZoqtpiomcsbH4E5aXH2w1fLsD2g w==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="371105595" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208,217";a="371105595" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 19:27:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="959341917" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208,217";a="959341917" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 20 Oct 2022 19:27:14 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 20 Oct 2022 19:27:14 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 20 Oct 2022 19:27:14 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.48) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 20 Oct 2022 19:27:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RdflwNMB1PmqVY3/Kg3wSO0WqS8cuk5hxzmWLd0v5MNIxcVTqeXOkpVxM1rEi+HYVeZR+3wibJoTGoWFChPYFkvl7plfZB1mtnirgbVCerGcXOYcCrUhIkfxttNx/SqUKu4qwP7kGAuSQOA3Zlzi6eMR0GFseJrP/la9QWV/WvcLKlyjFY57O4BybKOmPzpmDL0dXnFFi0PdCAmbG5nIfdBvkhYvGg9vSupph4dEmEyVLq1smF8v9+wgo8KJmAtFvAYInuZ06cK/byRz6WJy9lFGeeKheItfLGf1WlHrr9e7oPIDcCtYw2bbkR7NdjEmKSalQwAnBaTWEgpsPrkOlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wi45SFt0GGWs7gLh3808L1d4I/TxUBClkW/Hk/becFI=; b=c3JrkWZ2n5ND4jZIwlmkaYYV3SaSZ29gI9+RaKGtZLv+DPnOK/yvdWZJEm6yJfoA3H12vJPFOHutKccIM80jELMqcO7fZ6qEBD+iZgyMNp0xwbTMT4ZhiI7nUq2SFZGAmkJ8Z6RCMJ5G8ZT9X+wfMBK/DL4mtH3mbqfoH+3Hgi3IxwnAQKkUbbhxsAChFcYe4g17XoTQKQ6TWo5YXPHI2ii+u6eRjg5zpD8427xlMdG4VFw0UjcLf2aeMVSyINfHK80+1haJsYGrAMozU7y2zTDl9IVmM+TcbtvMP9oio412ET5PglZrODC6TsPjz/dIJeyfO6qMWoy+ouHGqIAXGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by BL1PR11MB5286.namprd11.prod.outlook.com (2603:10b6:208:312::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Fri, 21 Oct 2022 02:27:10 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::82ad:97fd:4cd6:b7ae]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::82ad:97fd:4cd6:b7ae%3]) with mapi id 15.20.5723.035; Fri, 21 Oct 2022 02:27:10 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Anbazhagan, Baraneedharan" , "Albecki, Mateusz" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting Thread-Topic: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting Thread-Index: AQHY4wn6KyQOjdfwO0qXOMsy/99GUq4U7akwgALsQoCAAEYoYA== Date: Fri, 21 Oct 2022 02:27:10 +0000 Message-ID: References: <20221018155419.2808-1-mateusz.albecki@intel.com> <20221018155419.2808-2-mateusz.albecki@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|BL1PR11MB5286:EE_ x-ms-office365-filtering-correlation-id: 4c8255f4-75f9-4cbe-cf97-08dab30bc1d6 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WBJ8tqiCXyG1HxhQtnDvl9h2mv3FhXXMkeBooA5IoOwFF+Hxl/J/54Du7zT38vIJbWaa0I56ovWJKfAJ7dsjQvpbpcxtoEkw77x/u4hm3OowCfsE0MZsFtq9ppsRLd1uqmTw9KveDHNx2v5qwfi/vliKPevDnu5QfKyGxnn3T1Eg/+xw21nzJMSnNoJw0+3POMH+ugCc5W8LHsizyXnio7qy62PzD5Xex5pqXBD1MOQm7QBlAXhG7g5i9kWCo55OTW8LYNepa/lxp5umY1SW71IVPlFyawaMaY+Lzv1BxBO87j7QpoD0qCWVbx6VCNKliV1XerXaLZQXfzM7ShirieVnJALWG+GdplKMn2Az+Wnu3bZ+8Imq2diMjfOKinsgKnD7vusAaxO9O8ljaRaS3XIUtcq5Fmx7HeUD80FpnQ9trUojsE63G/0aQ50HFutwNbZuRgG+cTuCiuo0C6gYFY7DtfY0UfdnjdSEu/Eqh8SDoAYE6VhaTyH8ZJGdjAsL61lCcgcOxw2ffpopn48Yc3Y8g7dknjPstIc2JCPoe8GBVm9bavrfuMh7nig07s78CQfoOMzMvlw50Ikhn5ywaka9YCHwceu6r465r0b42IaWcye4JSimz++QA4Kt6FpjNNsneUtQRj9ZAgcI6bYT4IZfxXjV9Y7TeJoqUOcHdfUoraOA60XSPuOgdoJlRImSihB3qqxfgwWYUeohfdma+rV1qZ0lrH7YuXdFO754D4yIQ7q4NzpBCrBUiyIzPXUYRV8nvyM2vzu8cublDOUo4GT8Ahfsxcjz8hYwharqq6H6fBi+cx/vMVs+9hbR07lexYGFhNWuP6nflaQOoxFtAQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(39860400002)(376002)(366004)(346002)(396003)(451199015)(2906002)(66899015)(33656002)(478600001)(966005)(82960400001)(166002)(71200400001)(66446008)(316002)(6636002)(6506007)(38100700002)(110136005)(38070700005)(107886003)(7696005)(66556008)(122000001)(66476007)(8676002)(64756008)(66946007)(4326008)(53546011)(76116006)(8936002)(52536014)(86362001)(41300700001)(76236004)(9686003)(5660300002)(186003)(55016003)(83380400001)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1sha5Zn2sVw27icKcQaeLF1wddQ62Si5YYkVySAUrJM8n9W4ngXTjOcm2L++?= =?us-ascii?Q?6xwQle/JGaRTTw+OiDnPsp4+CdmS4zG4PVuNe2N+5XkbiyDn4WXy7J4P5tS4?= =?us-ascii?Q?DDTfQLrBUb+BBeBuH2cYEgpa0Vk2DNnDaPMac0Dd+UURGyg5KlMIPwbq67/E?= =?us-ascii?Q?QIBuCUJuTJrt+zy2IhS3pvh8U81j2QJKpEivIJEyztCTBHUv8bxpDI9kMADB?= =?us-ascii?Q?aO8hiEBeUDgy23KakA9NkFlWwxPopg/d46YoWTdj/wrZB8CCQxk/5DAX75ZH?= =?us-ascii?Q?q5WRTWzQIr554te0cNND/+yeGOFHuDTS8R6s2KYhiKh2YdjvAcqIBdcAnEHq?= =?us-ascii?Q?f3YlAXuWBhc3vX++KOePU28klLzR8zvgDjqRJvRCMIsMSNyh1TQx+CxOIpxu?= =?us-ascii?Q?v7931QgziBBvA5irNetq7qhm3MLRNMaPKrWy7F2c+n7OzseF4yIGlv43+Ock?= =?us-ascii?Q?+Yuh4oUSi1n/HKRH9yH+V23udiqPEj+2BF/XkMTJBQeEp9zo1gPa0LtPSLC3?= =?us-ascii?Q?QSZjHm/0Vp79ld7qk/3OTiXx1h8dsLbGD35WUOMpbAZuhIngF/5BLoiE6J82?= =?us-ascii?Q?+/Gp3yhWmKelR58BnFlWZTQ32Falp5v19F3m2VPILtpqFbwNvhu78FyDMtov?= =?us-ascii?Q?lkrZCSjGd8RFuvAxCWq+2JWIyV4ZlCDAQGf/92g7GKH/PcqPCFWinHa8sOn2?= =?us-ascii?Q?x/6utwD7A0G+u1cCiFCiy/espAIk1w6OgoWVl1C7qAJ/NvfK/sWsarSmY8Hb?= =?us-ascii?Q?5iRRYLzgeJKDBevWaauH5xnqPDDceY8mOENf1YjElFMDk9gI5mue7HHYWsEQ?= =?us-ascii?Q?xRtuDLmstXFd/RK5MQaB2vGh90H1sb+a9iY3q8aU+g+q2EVT63XD4r6P3Jms?= =?us-ascii?Q?+9R1Wg9euwB1yxIfedX4hGiOHBouw8RnP1lZpfFNI1QJLoI97qDNB+VGrhKD?= =?us-ascii?Q?HopXKZbERRH9D4nnHretXkBlr3Wj0e7WjoX2ncrPj+JKz5cS8Rm7T0QACQCB?= =?us-ascii?Q?BRp6PyFFImXg8dsRliR65DXP//cduQxmvoLu9PCbVbsEPUhQkhm3TKaPjKtl?= =?us-ascii?Q?z5/ugcAQgDMDj5LLiwh2qc4DKCXoIhWkEtiUwn6Qsp+4pPg98nFUBjN94LzS?= =?us-ascii?Q?luYnPRJ7F85a8U7aesx6/ZaRlgwRQUbEaR+VG4ZUt22IcQN6AEukX2atUD5V?= =?us-ascii?Q?kukFrxIPKYgYQLpAUU86SovQDRGmk9Js2WUXfgDPOAwU+PPECZ1GiIhPcQv6?= =?us-ascii?Q?niv9DLSlxGlPK9+Emj9AAjU9C3WC04MNeibyKD16UrAGtfC1dboxZtAl4iSD?= =?us-ascii?Q?yeyd40UmykLJCd4NhvguzBsr1UPeNT+3XLqJuti6On4ENsR93FfLV0F88QQ+?= =?us-ascii?Q?rFSKcHMLCfdhls138uu14lTisQuLI6uyiPNepMEGR3KTMx3W572QZgAStagk?= =?us-ascii?Q?RKS86DEPOPSUPFQXF0m1ca3fbzQnpbAZRrEsK+1sWkqyaNt2q80dNfG83858?= =?us-ascii?Q?UvSBz90Fq4M4fJNXV/EW2eHMVqeBo+tEv/KgIKAJQuEJkmGxPii/GDFGktXK?= =?us-ascii?Q?+NDKUwapYWPPDh7CqasCjeDORX3muV4tab9ZLDHK?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8255f4-75f9-4cbe-cf97-08dab30bc1d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2022 02:27:10.3970 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zLAz6Wuw/qcwFunnr2HQQIazVaowGDFi0p3YMMJem9GwVtLgkh360TsoOnc2csvfbVL5aMUe20ovoe87jEnlWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5286 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR11MB4025BBD2FBD3E8F2BE5F49F0CA2D9DM6PR11MB4025namp_" --_000_DM6PR11MB4025BBD2FBD3E8F2BE5F49F0CA2D9DM6PR11MB4025namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I see the point, thanks a lot for the testing. Best Regards, Hao Wu From: devel@edk2.groups.io On Behalf Of Anbazhagan, = Baraneedharan via groups.io Sent: Friday, October 21, 2022 6:05 AM To: Wu, Hao A ; Albecki, Mateusz ; devel@edk2.groups.io Cc: Ni, Ray Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command status = reporting Below patch didn't resolve https://bugzilla.tianocore.org/show_bug.cgi?id= =3D4011 since AhciRecoverPortError return success on incorrect drive passwo= rd and continues with additional retries before returning to caller. From: Wu, Hao A > Sent: Tuesday, October 18, 2022 8:37 PM To: Anbazhagan, Baraneedharan >= ; Albecki, Mateusz >; devel@edk2.groups.io Cc: Ni, Ray > Subject: RE: [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting CAUTION: External Email Hello Baraneedharan Anbazhagan, Could you help to check if this patch can resolve the issue https://bugzill= a.tianocore.org/show_bug.cgi?id=3D4011 when switching back to: "#define AHC= I_COMMAND_RETRIES 5"? This change can be accessed for integration at: https://github.com/tianocor= e/edk2/commit/f2eb27e00ed55cca03964f13a2839e41e2c1f61f.patch Best Regards, Hao Wu > -----Original Message----- > From: Albecki, Mateusz > > Sent: Tuesday, October 18, 2022 11:54 PM > To: devel@edk2.groups.io > Cc: Albecki, Mateusz >; Wu, Hao A > >; Ni, Ray > > Subject: [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting > > 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/MdeModulePkg/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; > > > > if (Read) { > > Flag =3D EfiPciIoOperationBusMasterWrite; > > @@ -1026,8 +1027,8 @@ AhciPioTransfer ( > > > 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; > > > > Map =3D NULL; > > PciIo =3D Instance->PciIo; > > @@ -1220,8 +1222,8 @@ AhciDmaTransfer ( > Status =3D AhciWaitUntilFisReceived (PciIo, Port, Timeout, SataFisD2H); > > 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- > >RetryTimes)); > > - 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 function > again > > // and on next call the command will be re-issued due to IsStart being > 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; > > > > // > > // 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 { > > -- > 2.28.0.windows.1 --_000_DM6PR11MB4025BBD2FBD3E8F2BE5F49F0CA2D9DM6PR11MB4025namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I see the point, thanks a lot for the testing.<= /o:p>

 

Best Regards,

Hao Wu

 

From: devel@edk2.groups.io <devel@edk2.gro= ups.io> On Behalf Of Anbazhagan, Baraneedharan via groups.io
Sent: Friday, October 21, 2022 6:05 AM
To: Wu, Hao A <hao.a.wu@intel.com>; Albecki, Mateusz <mateu= sz.albecki@intel.com>; devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command = status reporting

 

Below patch didn’t resolve https://bugzilla.tianocore.org/show_bug.cgi?id=3D4011 since AhciRecover= PortError return success on incorrect drive password and continues with add= itional retries before returning to caller.

 

From: Wu, Hao A <hao.a.wu@intel.com>
Sent: Tuesday, October 18, 2022 8:37 PM
To: Anbazhagan, Baraneedharan <anbazhagan@hp.com>; Albecki, Mateusz <mateusz.albecki@intel.com>; devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com= >
Subject: RE: [PATCH 1/1] MdeModulePkg/Ata: Fix command status report= ing

 

CAUTION: External Email=

Hello Baraneedharan Anbazhagan,

Could you help to check if this patch can resolve the issue https://bugzilla.tianocore.org/show_bug.cgi?id=3D4011 when switching ba= ck to: "#define AHCI_COMMAND_RETRIES 5"?
This change can be accessed for integration at: https://github.com/tianocore/edk2/commit/f2eb27e00ed55cca03964f13a2839e41e2= c1f61f.patch

Best Regards,
Hao Wu

> -----Original Message-----
> From: Albecki, Mateusz <mateusz.albecki@intel.com>
> Sent: Tuesday, October 18, 2022 11:54 PM
> To: devel@edk2.groups.io > Cc: Albecki, Mateusz <= mateusz.albecki@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>; = Ni, Ray <ray.ni@intel.com> > Subject: [PATCH 1/1] MdeModulePkg/Ata: Fix command status reporting >
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4016
>
> AtaAtapiPassThru driver was reporting recovery status on failed comman= d
> packets which led to incorrect flows in upper layers and to SCT tests<= br> > fails. This commit will change the logic to report command status.
>
>
> Cc: Hao A Wu <hao.a.wu@intel.= com>
>
> Cc: Ray Ni <ray.ni@intel.com>
>
>
> Signed-off-by: Mateusz Albecki <
mateusz.albecki@intel.com>
> ---
> .../Bus/Ata/AtaAtapiPassThru/AhciMode.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> b/MdeModulePkg/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;
>
>
>
> if (Read) {
>
> Flag =3D EfiPciIoOperationBusMasterWrite;
>
> @@ -1026,8 +1027,8 @@ AhciPioTransfer (
>
>
> if (Status =3D=3D EFI_DEVICE_ERROR) {
>
> DEBUG ((DEBUG_ERROR, "PIO command failed at retry %d\n", Ret= ry));
>
> - 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;
>
>
>
> Map =3D NULL;
>
> PciIo =3D Instance->PciIo;
>
> @@ -1220,8 +1222,8 @@ AhciDmaTransfer (
> Status =3D AhciWaitUntilFisReceived (PciIo, Port, Timeout, SataFisD2H)= ;
>
> if (Status =3D=3D EFI_DEVICE_ERROR) {
>
> DEBUG ((DEBUG_ERROR, "DMA command failed at retry: %d\n", Re= try));
>
> - 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", Ta= sk-
> >RetryTimes));
>
> - Status =3D AhciRecoverPortError (PciIo, Port);
>
> + RecoveryStatus =3D AhciRecoverPortError (PciIo, Port);
>
> //
>
> // If recovery passed mark the Task as not started and change the stat= us
>
> // to EFI_NOT_READY. This will make the higher level call this functio= n
> again
>
> // and on next call the command will be re-issued due to IsStart being=
> 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;
>
>
>
> //
>
> // 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 {
>
> --
> 2.28.0.windows.1

--_000_DM6PR11MB4025BBD2FBD3E8F2BE5F49F0CA2D9DM6PR11MB4025namp_--