From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.3201.1666143685253621296 for ; Tue, 18 Oct 2022 18:41:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=VlA0V/gb; spf=pass (domain: intel.com, ip: 134.134.136.24, 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=1666143685; x=1697679685; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KaGmJhHiSK9hqQWOwX7GuTMVj3QsYBGWhOQIOmpFhd0=; b=VlA0V/gbl2uAhBqIwLISVJJnfOqUQxgACQUPz/ZRocJhTvS/gp4ed8YF defwO+hJh1rmQOAQ2kGLVaD80ZQoiudn0jmMljZ469yVaexXiLSXYTQ0G KbXslXBkSnXGveucc31Jx7Ew0EGv07rU80NSgk17zhAmMcP4iIWh6Zdz0 Rj0G7ZNEYLhy9FQIdoDCv40D9HB0oaFfwyt/urJSMm7H8U1YjYExZFGzB A0iC73qZ4SAcpVq5e14M38a4pPTUFdZWi6gl2GiklzhkXzwMFPS9x4w/r mLtY2gc+nOdaZjoVJbPqSfjJNJunUCy2BwKE07O2aSm0J+WOCjM5S5hKD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="307388636" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="307388636" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 18:41:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="606841292" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="606841292" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga006.jf.intel.com with ESMTP; 18 Oct 2022 18:41:24 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 18 Oct 2022 18:41:24 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 18 Oct 2022 18:41:24 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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; Tue, 18 Oct 2022 18:41:24 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 18 Oct 2022 18:41:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMxczFgZkotGu0J3MswaPmySJxGXzJc71dsbiwCEPgmN1rZ1P7u61m1BuRQA7X4QZ24XxpoL8hPwbCLcUHGlAGhZOEbvwNwm+gfn2THLOBpi/HcBq/0PAydChwokrpCCTKL93/PXAGMqahG3AqhdhVvmiGMqI9VNwtdpTO0jahgXyiYei9Z48KTsezMl0yBmNnMdmZcLv0mZYCcOG4c1bA5IChgQokU5LFA8878o0wyqF+om3JDm9UuT67lZfdRHDJZbS5DlqrY8+8bBzUnVbSbEoAqeAOUruPZgCeNCub8p9Xuo0yUEN+uzGKdiUUYpySjktmxy94TJT9QU/5gcwA== 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=YxKTZr5TMEBdGyEipuIERtv9G7HvSZsYf51FRpmFk6M=; b=eGmihO61cYBxL50k/2M4Kq2KStoFUAJagZb+2FUZku+EXhpjUIoVKpkn3UebV6L853unHBKxy7XETsrxmKgpTZcb6cTt6cpFNPQL3PYYKwGK3E/NqKOExkx59Jl9biuxTk1U4OQrUBq9mjmOly6CUwk5ryXck2KknLKQ/dUW2OhvKA80hXk0Aq8fg/m+GFjc/AoWtdW2TwlDMEVHkwCsrMqOaHpoA8cdhaMwVArwukUDTrJfpn/IimeJkEVOh1qCd8Z+sspUAPJCDyB/Dc5tAk12SjR+orTQnfaRjIDBqPCO4CMczw/+91NJQbX3KbWNN1zNLzW0zKXsb/0IfAFqKA== 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 PH7PR11MB6032.namprd11.prod.outlook.com (2603:10b6:510:1d3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Wed, 19 Oct 2022 01:41:18 +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.033; Wed, 19 Oct 2022 01:41:18 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Albecki, Mateusz" , "Wu, Hao A" CC: "Ni, Ray" , "Anbazhagan, Baraneedharan" 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/99GUq4U7akwgAAC/FA= Date: Wed, 19 Oct 2022 01:41:18 +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_|PH7PR11MB6032:EE_ x-ms-office365-filtering-correlation-id: ec6be33e-975c-4ad7-ca57-08dab17304db 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: b3Zcs5IgeUGEBivMaHAvO2aU3FMHgpir2ynLVGJWzIazPwqcq+Q2aqT16ZAdcQV/SQtOEk8aLxR4+kAww4TgTuvMOrgMfsKA+AoVHrtiYlnG+tdE2G/jICsvb6mzOXN2WwG9fx3lRDPWGDOB0JVryfRdSbpRqR6dmC1VcclViUWQenQQ73TENF1CKNFK+NpQKYIft+n38p7B7vSP10h3kj16OB/OvAYydotWUt734tknoxopvSlF0UMOL0PR6vaQldtDQ+r4+RTTvMGS0/v4opB0MAhUJCYcNhlwh6RFeqqcLmDPi3Qft9kLa7KI4qHzz1WDlM3H/cMvjwOcaR1dk0ZDAYR5lMcOU7ew5t209imVh5bgVE8sAwLG18PjUfEYDawHm2dSENX7G5kLVk/tqtxQFhbIh6khdw3jKF3fU1ZB9Z3Cto7venENPRUd/3IvjCviha6cw6LdbaFgBCCzmQXDlcFRrpaVXZgSHtr6au05wkipl/tAgkaN1o34EWnW5hemijoV80RBbDIGuGKSuUeTIaATTC48JsAqFIbf9V6OUwXgxOVg0prrk3NebPFGH3/6dc3tRWCTaQVGrYJpqWx3iCGP0jCJeC5nhNMecKPCG5QHg0ma2/ayrZ4Nius379NuRIrqXd1wktMcoluf6ZUSl9Zh+u95ZJxQ0T4c2Lgr0AoEtA8GJmpuGvPybv5P+zl4w4X/aMLYR1fP7y42wrDVIZjFL0NZhWrckFr4iDZ7yvPy9IQWwIZlvsRezfasq5WoQygxwuNr/V05ogAJ0m76zMucAVTZeGGYT4gSzFvwrwgBJDnQaAtFSZS8gJJo5NYsf/IiD3bPbgMZcX2F/g== 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)(366004)(39860400002)(376002)(346002)(136003)(396003)(451199015)(66476007)(316002)(7696005)(54906003)(186003)(53546011)(6506007)(2906002)(41300700001)(8936002)(26005)(5660300002)(33656002)(2940100002)(83380400001)(52536014)(4326008)(55016003)(86362001)(8676002)(66446008)(9686003)(76116006)(110136005)(64756008)(66556008)(66946007)(38100700002)(122000001)(82960400001)(71200400001)(38070700005)(478600001)(966005)(66899015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PRvOcafijIsBH7ASCCNHjjpqWUP/hEq1h5H6fsXDO6tRvITBAtWv2Vfg0v5P?= =?us-ascii?Q?j4FMXHpIrduEPv7y7WoQT3NWsZbn622IX5Mij/CwieEuxz7ERmxNLGYzxzPj?= =?us-ascii?Q?8pw2wLkWb5aiiy2ZaC0asQvITh17xYTcbcmbxU0FxDP5x0g1d3I3dAiWfPHW?= =?us-ascii?Q?/uknmNPHMh4op2m1rhGW6TMTMByINwJXLRt2EGU+9B0ql7SIepTHf7FKis3q?= =?us-ascii?Q?L/z5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G04oagYYZcRkO?= =?us-ascii?Q?Yc6AhhrDJNB+B+zVCFV9RRQy9JtW7D6tfuLQJeIEv5p6quIgrTR1zMR3b6GS?= =?us-ascii?Q?oDhcnwCE4eOz4Gqbp8d+RM77bcJhJOJe53qcIu8E+y3KE49kIIJ3fJQyWvcU?= =?us-ascii?Q?amzpgHPFvGgmKQvxhd0VwFGavBzX9lIdTmjC1muAs8SMerv4UwiNL5PkoEFr?= =?us-ascii?Q?79kiD1p/EiH+CJ39PIFwiRxDgUxAM4w35C0PLZQyKq2koFl7kcT8fk54+4zs?= =?us-ascii?Q?QLdeNGskTqIREjKoee8OHlW0Fqh3Eg31op8NSefbFy/jStmqtX0iqDj5M5tB?= =?us-ascii?Q?sz8TRGRzxusqaYgzVEQ0IMRnuqCrmYhkSOSy3RWQi4v3XZXEMgYmEZynGbTV?= =?us-ascii?Q?GdMr6n2DABqBqsvO45+0fds0B2wpAI04CLz7uQNgtvmK2vMYJsoZtCXTw8kc?= =?us-ascii?Q?YaZotsjMQ80yppbgMsTmOvlNqoBzM2gy3WybZ7GB?= 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: ec6be33e-975c-4ad7-ca57-08dab17304db X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2022 01:41:18.6746 (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: 8ABeCSF3cXV1CFFd7w4+5mydHO9jbgM2xRWk5zl4mBWTgEU/1x2tB2zYNUPpElo/ge54aGEhFXYzjGVN8XF2QA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6032 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Mateusz, Thanks for the patch, I think the patch itself is good. Sorry for one question came up when looking into the patch, for the impleme= ntation of AhciRecoverPortError() https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Bus/Ata/AtaAtapi= PassThru/AhciMode.c#L737: Status =3D AhciResetPort (PciIo, Port); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "Failed to reset the port %d\n", Port)); } I cannot remember why EFI_SUCCESS is eventually returned for the above erro= r case. Could you help to remind me of the details? Thanks. Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wu, Hao A > Sent: Wednesday, October 19, 2022 9:37 AM > To: Anbazhagan, Baraneedharan ; Albecki, Mateusz > ; devel@edk2.groups.io > Cc: Ni, Ray > Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/Ata: Fix command statu= s > reporting >=20 > Hello Baraneedharan Anbazhagan, >=20 > Could you help to check if this patch can resolve the issue > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4011 when switching back= to: > "#define AHCI_COMMAND_RETRIES 5"? > This change can be accessed for integration at: > https://github.com/tianocore/edk2/commit/f2eb27e00ed55cca03964f13a2839 > e41e2c1f61f.patch >=20 > Best Regards, > Hao Wu >=20 > > -----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 st= atus. > > > > > > 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 >=20 >=20 >=20 >=20 >=20