From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.32145.1613983095288470077 for ; Mon, 22 Feb 2021 00:38:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=jxt8Wa/j; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: hao.a.wu@intel.com) IronPort-SDR: VOI2JpMrZ/KxCuK6g0BMgfaI1I9B7xBR9ibKNfKGmSxKw0wUZIqZirpXMmgThcshkD7w1Bcuo9 X4Rdbn92X0dw== X-IronPort-AV: E=McAfee;i="6000,8403,9902"; a="269308396" X-IronPort-AV: E=Sophos;i="5.81,196,1610438400"; d="scan'208";a="269308396" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2021 00:38:14 -0800 IronPort-SDR: wBzettNVV+ql32BMXIjXwWHiMD69ybF9P/LWq0O+M7Zx7zKumZr36TodVOzngskoyuAN/SjdaP gDb3mVYWtgww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,196,1610438400"; d="scan'208";a="389735189" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 22 Feb 2021 00:38:14 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Feb 2021 00:38:14 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Feb 2021 00:38:14 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2106.2 via Frontend Transport; Mon, 22 Feb 2021 00:38:14 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.47) 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.2106.2; Mon, 22 Feb 2021 00:38:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIYoo7Wy+y5MkD7XR6Gm43ytdg0cJ628jxiC9xxwIxrHqABpfU1l1w0nkHYokr53vI7PZUNZAHhkS2wj86Vp17CiIZUsTqmZ/siUL+qgP255yXUfYHXNgIoDT7ejoW+CWSs6q2ZUzGa5UC38TNz3l77+gWYdkJYt9bza5HXa37ehHDl30Zk9kizMOxJsTraQsX6B8pxATyIMYb878NkX2uI5AzibexlZhk9M77qNBQjJg6tXsZ4rkxH128GCOBVC3tX/mV/HIPJgZStDjFZR1WVrn1rF8oDC/Ekl3KLLeORxL67vlhsNTIF2SYSvFBA3LbTAi8QlyBlEJwYJ1axEwQ== 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-SenderADCheck; bh=7eOaTj7d0/PAVm58Du32luapK7fJzAiNvh1u46j2rTE=; b=XoQG5TRKQOpz4fbmzQPHkn23D8OJH9sI7kwzYkpk1MLIQxwlO5nD2n/q/vnSMGVVy1fpXdsm2IC7reY3bFarQHBRYUWQgubwjJs6RyFm4/3XZRjA5Iri1KJvz7D5SROfASNuN1qK4UFZwI6/6m3Gt0l9THrjkYy+vhVynfFFbU3RAmR/EnzAk0mV9znmKq7B8ShA1IkTe7nxo4V8Dn7YwMI58a4+yIqQTlHpXUAMq2VlLIm/DwuAIDCGoDSrQGni0lNqk+IT1WCYMv2IsoRi/l3elgWtIA/ojZ7ACsYiBr4Kmb6zMYNkhNxpYFvBStOnSNQ+xpkAhxpZ+k0vioEgEQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7eOaTj7d0/PAVm58Du32luapK7fJzAiNvh1u46j2rTE=; b=jxt8Wa/jFIlSysII0g6UH3wmFKFvRVZ5W3t3gFGCOb2bjXm42NIWvNjh4uzz4V937a2sc6EniqIyb4B2FZbIbVsHw6l+3exS2LKB2j/D+XCV6at2VLUw6B9zVEMZqxi1X17h69QCBQxbZvdG6CKJQXe7Y8sXfpA37PyPIYtqz4A= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB4004.namprd11.prod.outlook.com (2603:10b6:405:7c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Mon, 22 Feb 2021 08:38:09 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::9d91:6348:53a9:cb20]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::9d91:6348:53a9:cb20%7]) with mapi id 15.20.3868.032; Mon, 22 Feb 2021 08:38:09 +0000 From: "Wu, Hao A" To: "Bandaru, Purna Chandra Rao" , "devel@edk2.groups.io" CC: "Albecki, Mateusz" , "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/UfsPassThruDxe: Improve Error handling of Ufs Pass Thru driver Thread-Topic: [PATCH] MdeModulePkg/UfsPassThruDxe: Improve Error handling of Ufs Pass Thru driver Thread-Index: AQHXBQuRLSwBS6euzEiT1FtH3mO6Vqpjs0Ag Date: Mon, 22 Feb 2021 08:38:09 +0000 Message-ID: References: <20210217090143.20032-1-purna.chandra.rao.bandaru@intel.com> In-Reply-To: <20210217090143.20032-1-purna.chandra.rao.bandaru@intel.com> 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: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 616dfb41-9afe-405d-e414-08d8d70d2f1c x-ms-traffictypediagnostic: BN6PR11MB4004: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hTPNuo6rirSmF2ShrCXf/DGJCheD1yS9MpHWAVK1sdnoWLjTRV6dlwzTZPHeBVjidJdEcJxGS1nSR1Faqdnds6danNKnJiKH4mzvq5WhUcH5sHXtp+KssI0EIR6UrtK3Vi0AulYBMutpBT7glYjwOqfSeQnRH/3EwoY52h7ayg1wALyMnOvodVALVdJk5M7WH9k0sHe6zE0OK3Q1Tnwz8EuOmO+SMw7TcuexpMc6pIoFp1Gor1m5Ldng7gmnhfNj7O0v8M3fK+Ov8+1lGzWrV8QKxOqidWltnppxtJKsTp9o2Cw0fETGt8kx8pKsyxf70s5kVBbMcb8Rck78ghZD7NL9sIMogQPkRcDhoQapkawjXiGyYTRntArKibVCwXBbPGR0zLrgoCBtCU8gvsCKGAfUdd9Iwf/kxA4CgplFCQ2TewWnBf7OJxDvQxVEdIPzTLUL4iWGYOeDyc1w9934PuVf+4nVvy1Pf01oPD6H7u+uYgFV18sH8Ciqbl9cm2nRjrc6wI7Ao0Eu5PANAqL4Xb3UdVEEjthtwEgrC8Jjo424Me3C3AKUlL5f/X28L40BXv/GleVMNUF+13JqjiYjKI3QEjXJw94nFJjXJpiHKcc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(136003)(366004)(376002)(396003)(39860400002)(33656002)(186003)(19627235002)(26005)(71200400001)(2906002)(6506007)(76116006)(86362001)(45080400002)(478600001)(53546011)(8936002)(966005)(7696005)(64756008)(316002)(110136005)(9686003)(55016002)(5660300002)(66446008)(66946007)(66476007)(66556008)(54906003)(83380400001)(4326008)(107886003)(8676002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?vlt9RF2qAtN4DOQoDIEtJyRVDmIzj1tTVPxgp0hYnCYnw6iXlRn1G8lPcb9w?= =?us-ascii?Q?duSPe6rx3KivKrebHh6QyPZ/bZOhmLIpfbgeyVqydV3m976WKXBXInazdjOf?= =?us-ascii?Q?ps7xB07FP7NR9Zvjpd8g0niyTgK4VUgMQ39THlL3+pbqd4ATCB+md82hL188?= =?us-ascii?Q?V9p4SU3H6AC7SW1NOfXwkk4ik5x0cd6utWzDMZbq83ERcqGqtnSUxgpXMkI1?= =?us-ascii?Q?xGlwEsKk9zqynMm7f2pC374n8hQH5xmKfywqa3DxZe4pA1DyyZKzoxJr51u2?= =?us-ascii?Q?7ZJ+FfCikiL9EOsZHzVbtciNoRgsUlYBDvmWfaAoUQ1mJ6RGttqqHqcEGsPx?= =?us-ascii?Q?44V910xZG+LlEFdaE0aJOgxUZuUZOLs9a7I7KAIW0kM0uMJ+Orss8EMDSiKO?= =?us-ascii?Q?2NmXX6wU4a5DMLSmwG9XBN1lV6xoVbcIqOHBnyeJfI0Fyj6yHsDwI3CmgnmD?= =?us-ascii?Q?wxRGalWIGJS1gEOXP4N5wr1cEhn/9VmpNYhTU5rY2Lx+MUzKxYzwVSx/Abax?= =?us-ascii?Q?EFoXAsoF77L7qTmcdjtNvydDzhwAF6GgEdgH+9p6S0PPvXxjgvsyWSZm+dNo?= =?us-ascii?Q?+o73CCXeAJs6c22qMZn/mzM8lO0GwX8EhU7kBHUg7UPfGmUtwChsToprFU28?= =?us-ascii?Q?eoLuEx57AUHsiPH8iS2WzBIKTT71QgBxH3sYQsiabsBzgwFvGbZafFcr2R8j?= =?us-ascii?Q?tV50GH3E8OXOpu5TiSS8C8DN2YrenDOLGXl+RF8OF7/vaOt1iAm9dE7OvkgJ?= =?us-ascii?Q?X+wET+1tetFE3Y+siVxHgRwm7vo5ueCg3OeU/jtfGlF2/MV83Tq6KnLLwewY?= =?us-ascii?Q?dzYFGR45LIWOukGKOSE2IAA6sOtlLo7emfrgxJpigJub0yk+BX87KNCZpemh?= =?us-ascii?Q?XpYpSIKXL2CaUBvhOQrSFgA/Mkyvvm2lWMKEMWJ2G8/NS+de1IklrFvwDJP5?= =?us-ascii?Q?26XeM+taXq5+s1R7zF5NVaHCPYFOD+9CHqcR+UKQFfD6Go760vGVuJXGPyJX?= =?us-ascii?Q?WVE5iIAT0HlnAEMH0DGFUjqRRLAHcU0sDT3beT40xzrs3wAjHtItAAIGcNar?= =?us-ascii?Q?3Pku+Fs5pDiNvjPo9kTiOk19G2hi6IXUdZE4C4dZGPWVSSQ18/esJm+tFEr7?= =?us-ascii?Q?BfFCWewzHNnuy7Yegx29uFrwYzxyizpS0DbqjgBX4BljVMdfNLAgCDLBAJgj?= =?us-ascii?Q?GEaUZvdSStjR8hbuFwazjDW579GP04UH1Fdvx0r6LjXFlN7korEMeJgPiszB?= =?us-ascii?Q?u9/LjdDJCxbAtMcRGkdNIyQFIpHeEnLVBLZCnIky2gHRDcigGgtWTOrX3eXv?= =?us-ascii?Q?/7/TVHs1Zd/3eVrBTiEzQrWi?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 616dfb41-9afe-405d-e414-08d8d70d2f1c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2021 08:38:09.6515 (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: 4Aybio5WIOBGVPDaJSzC11qb970uJQGu6LVU2de+wSUobM5L9czicrzIpKv0Rj5uHj9s2dtw0haeTjAr2EQ53A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4004 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 > -----Original Message----- > From: Bandaru, Purna Chandra Rao > Sent: Wednesday, February 17, 2021 5:02 PM > To: devel@edk2.groups.io > Cc: Bandaru, Purna Chandra Rao ; > Albecki, Mateusz ; Ni, Ray ; > Wu, Hao A > Subject: [PATCH] MdeModulePkg/UfsPassThruDxe: Improve Error handling > of Ufs Pass Thru driver >=20 > From: Bandaru >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3217 >=20 > Following is the brief description of the changes > 1) There are cards that can take upto 600ms for Init and hence increase > the time out for fDeviceInit polling loop. > 2) Add UFS host conctroller reset in the last retry of Link start up. > 3) Retry sending NOP OUT command upto 10 times Hello Bandaru, Could you help to break this patch into a 3-patch series in V2? With each patch handling just one of the above 3 improvements mentioned. For improvement 2) above, I do not see such UFS host controller re-enabling= process being mentioned in UFSHCI 3.0 spec section 7.1.1. Is this process being documented somewhere else in the spec or suggested by= device vender? More inline comments below: >=20 > Signed-off-by: Bandaru > Cc: Mateusz Albecki > Cc: Ray Ni > Cc: Hao A Wu >=20 > Change-Id: I6c0dbc1c147487e51f0ed5f2425957ae089b0160 > --- > MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 26 > +++++++++++++++++++++----- > MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 18 > ++++++++++++------ > 2 files changed, 33 insertions(+), 11 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > index 9768c2e6fb..89048745be 100644 > --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > @@ -1,6 +1,6 @@ > /** @file >=20 > - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> + Copyright (c) 2014 - 2021, Intel Corporation. All rights > + reserved.
> Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -749,7 +749,7 @@ UfsFinishDeviceInitialization ( { > EFI_STATUS Status; > UINT8 DeviceInitStatus; > - UINT8 Timeout; > + UINT16 Timeout; >=20 > DeviceInitStatus =3D 0xFF; >=20 > @@ -761,17 +761,23 @@ UfsFinishDeviceInitialization ( > return Status; > } >=20 > - Timeout =3D 5; > + Timeout =3D 6000; //There are cards that can take upto 600ms. Please help to add a macro in file UfsPassThru.h: #define UFS_INIT_COMPLETION_TIMEOUT 6000 And use the macro here. Also a minor comment, could you help to use the below comment format? // // There are UFS devices that can take up to 600ms to clear the fDeviceInit= flag // Timeout =3D UFS_INIT_COMPLETION_TIMEOUT; > do { > + MicroSecondDelay (100); //Give 100 us and then start polling. For the above delay movement, do you observe any side effect for the origin= code? If not, I prefer to leave the origin behavior: do { UfsReadFlag(); ... MicroSecondDelay (1); } while (...) since doing so will have the least performance penalty for devices that res= pond fast. > Status =3D UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus); > if (EFI_ERROR (Status)) { > return Status; > } > - MicroSecondDelay (1); > Timeout--; > } while (DeviceInitStatus !=3D 0 && Timeout !=3D 0); >=20 > + if (Timeout =3D=3D 0) { > + DEBUG ((DEBUG_ERROR, "UfsFinishDeviceInitialization > DeviceInitStatus=3D%x EFI_TIMEOUT \n", DeviceInitStatus)); > + return EFI_TIMEOUT; > + } else { > + DEBUG ((DEBUG_INFO, "UfsFinishDeviceInitialization Timeout left=3D%x > + EFI_SUCCESS \n", Timeout)); > return EFI_SUCCESS; Please help to add two spaces for text alignment in the above line. > + } > } >=20 > /** > @@ -905,9 +911,19 @@ UfsPassThruDriverBindingStart ( > // At the end of the UFS Interconnect Layer initialization on both hos= t and > device side, > // the host shall send a NOP OUT UPIU to verify that the device UTP La= yer is > ready. > // For the NOP OUT - NOP IN improvement, could you help to provide more inform= ation on what is the current issue for some devices? Is it a timeout happened for: Status =3D UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0= , UFS_TIMEOUT); (If so, have you tried increasing the last parameter like '10*UFS_TIMEOUT'?= ) Or the case is that NopInUpiu->Resp has a non-zero value? I found that in the UFS 3.0 spec: |> For some implementations, the device UTP layer may not be initialized ye= t, |> therefore the device may not respond promptly to NOP OUT UPIU sending NO= P IN |> UPIU. |> The host waits until it receives the NOP IN UPIU from the device... And there is no mention for the retry scheme. > + for (Index =3D 10; Index > 0; Index--) { > Status =3D UfsExecNopCmds (Private); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status > =3D %r\n", Status)); > + DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Index > =3D %x Status =3D %r\n", Index, Status)); > + MicroSecondDelay (100); //100 us > + continue; > + } else { > + DEBUG ((DEBUG_INFO, "Ufs Sent NOP OUT successfully and received > NOP IN, Status =3D %r\n", Status)); > + break; > + } > + } > + if (!Index) { > + DEBUG ((DEBUG_INFO, "NOP OUT failed all the 10 times Status =3D > + %r\n", Status)); > goto Error; > } >=20 > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > index 0b1030ab47..4fa5689196 100644 > --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > @@ -2,7 +2,7 @@ > UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU > protocol interface > for upper layer application to execute UFS-supported SCSI cmds. >=20 > - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> + Copyright (c) 2014 - 2021, Intel Corporation. All rights > + reserved.
> Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -1929,17 +1929,15 @@ UfsDeviceDetection ( >=20 > // > // Start UFS device detection. > - // Try up to 3 times for establishing data link with device. > + // Try up to 4 times for establishing data link with device. > // > - for (Retry =3D 0; Retry < 3; Retry++) { > + for (Retry =3D 0; Retry < 4; Retry++) { Please introduce a macro in file UfsPassThru.h: #define UFS_LINK_STARTUP_RETRIES 4 And use the macro here. Also, is it necessary to increase the retry number by 1? Or the device can be successfully brought up by adding a host controller re= -enabling? > LinkStartupCommand.Opcode =3D UfsUicDmeLinkStartup; > LinkStartupCommand.Arg1 =3D 0; > LinkStartupCommand.Arg2 =3D 0; > LinkStartupCommand.Arg3 =3D 0; > Status =3D UfsExecUicCommands (Private, &LinkStartupCommand); > - if (EFI_ERROR (Status)) { > - return EFI_DEVICE_ERROR; > - } Will the DME_LINKSTARTUP command execution fail at first and then succeed a= fter retry? If not, I prefer to keep the origin code logic to return error status direc= tly. > + if (!EFI_ERROR (Status)) { >=20 > Status =3D UfsMmioRead32 (Private, UFS_HC_STATUS_OFFSET, &Data); > if (EFI_ERROR (Status)) { > @@ -1960,6 +1958,14 @@ UfsDeviceDetection ( > } > } > return EFI_SUCCESS; > + } > + } > + if (Retry =3D=3D 2) { Please help to update to: if (Retry =3D=3D UFS_LINK_STARTUP_RETRIES - 1) { And add comments like: // // Try re-enabling the UFS host controller in the last retry attempt=20 // Best Regards, Hao Wu > + Status =3D UfsEnableHostController (Private); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "UfsDeviceDetection: Enable Host Controller > Fails, Status =3D %r\n", Status)); > + return Status; > + } > } > } >=20 > -- > 2.16.2.windows.1