From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.23387.1639470987326569973 for ; Tue, 14 Dec 2021 00:36:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.com header.s=intel header.b=AhZrG7kS; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639470987; x=1671006987; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zt3DcAosv0uCt55akpdKpxdQMV3lGc5zjTCzFHmon1k=; b=AhZrG7kSq39QK29kwATMQef//I2ar1efYFNad233q3bAWL90XKUeJR4Q eNsaTqI5qMvHkRxeGawxBR0mcKaPh4wIfYDINSvIcekhdAuXvuROQNwUR 1N8BfA3O/UK8hDTgi8KG8zNELJX7vEt+ZCU1tKAJRWmL62rMPqGFRXOX7 K3jQZE1Ii67fIZFR5aA3vEbpRjNGSYUtguovEJY0tfu7oUVsa+jY1KpEs vRLMej4yz8JyBLFlofSgEFT2NtIP4kMarGYjkZkP5GKll1i2/YUXP+JjQ 4gnhUrIvTng8H/xkK72/77PrqgIxsioNgcxZOu159sJuL4umNWl7GI//S Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="239152677" X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="239152677" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 00:36:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="614170873" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga004.jf.intel.com with ESMTP; 14 Dec 2021 00:36:05 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 14 Dec 2021 00:36:04 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2308.20 via Frontend Transport; Tue, 14 Dec 2021 00:36:04 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) 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.2308.20; Tue, 14 Dec 2021 00:36:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DsFg8EthyMpVOv1KKBWBbf13PSDAOr9LflzuaVrcKMFZP5mxmm0vYXYYOJO/4Mje5gUNS6hbA9NFwgLHzj7PWNysjCOxcxenNFBn2/euqqUx0cUUETgOuNT/uVSzwXlapmsrNYklaEJlQs3rjejdgbIgeQOKq/CtanrlJJsrEVH05w4tvGK/8k+Plo8LO2dXkHCUl8+eayXQL6BTRdLHnBU3zaFkKRTDWaGHeSglDKqz6VS5ysTkGjFI8faHc9u5RwHEOv2fWlXV67TgsBvXmLghUT0SAQOXQkTtttczA2JSjS3hKeQ/orNU8yTla5jSDOVJ+g0wdPlLnpe/HF3l4w== 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=VOf9F3MSvWzUYwhUcmt8d5ZAv5fJYoPFXbxokbk5eXc=; b=R2xDfJJl6xGxF4amagDthjkNWgujA3cOVwS8DG2DL3wY1MrRENvrTUoB4OguIQAhXE4i86Y15tNYdV3hi1OU52H/UX2PBqO5nhiIwYaXKWDlSm6xxHJlvbyXstRmdWnAfTQcgQZsis3VSaK3ujElKUXYFYOdnMou3QWdqTPXpKEnaQi4fQCro1caQ1yv06ejeUEnt7ddvsVmf3BX9hJ03EH3Q0MHctM/RHb+m69Sh/TEaaQu0+UcvIXqLp8vM0oMaRrGMsil4d3bBYRV58DE8VoBzBIN3KcTdWj19yiQtC1vxX+WZSlT2tqEJ83QiO1FIbFJsoe1B6QDFV7MAM9YWA== 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=VOf9F3MSvWzUYwhUcmt8d5ZAv5fJYoPFXbxokbk5eXc=; b=DiNyeaWHVK8lTokbKKJFjef/fyNYQnT32+mNiWx9HkCYT+xTuNRbppQV5rxQH8XWgdbYki8DMtZ8mmgrIIHxyjpRPdXFaPG5w1TEspE+3HRwYG7FZhvkPQaoOrCWsk2+XMVjSX7O0jk5pWMuZoShIpxq55bEZ3tjIcw8Ma7hDhg= Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DM6PR11MB3449.namprd11.prod.outlook.com (2603:10b6:5:d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Tue, 14 Dec 2021 08:35:52 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::b8f1:aa83:cbbf:6964]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::b8f1:aa83:cbbf:6964%5]) with mapi id 15.20.4801.014; Tue, 14 Dec 2021 08:35:52 +0000 From: "Wu, Hao A" To: "Ke, VincentX" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Chiu, Ian" , "Chu, Maggie" Subject: Re: [PATCH] MdeModulePkg: Replace with UfsUnitDesc to fix response timeout problem. Thread-Topic: [PATCH] MdeModulePkg: Replace with UfsUnitDesc to fix response timeout problem. Thread-Index: AQHX8Lb9aEnx9nJl0E2zq3P5LmIwv6wxpmAg Date: Tue, 14 Dec 2021 08:35:52 +0000 Message-ID: References: <20211214065014.14912-1-vincentx.ke@intel.com> In-Reply-To: <20211214065014.14912-1-vincentx.ke@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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9a4ca4f0-1c9c-4148-fa63-08d9bedcbcfa x-ms-traffictypediagnostic: DM6PR11MB3449:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:369; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vgJSj5C/sX9S0yy2NUHVk43SYwobc+mB8FcUUvagt3en2v+qqDu4M5zqZ1MrDtP4dRscrUrCsPXGJvraI4Agw65sEFaYyfHSFgG12crNKjprqxhDTTB3G8d53wLdu6TatVCTl0sxy7XEw95dVWWMgZhonPnjT6+q3GZGE9FRmQU2+iTZTaT64xvtEolW4TH3YleJ7Y5xPJxl/+4VOw4wc+d91cFKQEIy1meuczU8YYM1QhLmgNR6xdwE58Z8EeGOIhMWLVgsUVmd/S9lSYsHdjuCPSp4Ztb64tvQm0MfVym9RnTcaC9MqN7PcuXQQthg4gQFUvoJEddyLy8FA5vSXaDEtysOHBQiP8inDt9rqI/LZM3ymDEEyxAT3Trx6bQmZwrQDejt2vHI6c8XHp32SV4xDbU5Bi/GLhvEnrCpABt6ZgsSqxerEDdoYSkq2mG6CWmMTmnkyNTGHMtz4ckm3/zmV98mDtkFJNGoaEWvCWhbW9Kxxi/5wnBVEvcXMpbwT+arLlazUZTG4Mvun3uF0hx7EmpvkPAJL3gpoHINpkZPw6NnWXaVCkNA92SHwZ92rJj/jvZdWEKhziCLkOM1YBX6X0k3OKQGR6DphUYvlGY0tWYtcztXvPb6WVKRBWZ7DeRo5E/L8zmUCP3+NpCEDB2j4wYw5kvVHypMzE7K//XwXQcSd03hNqtiTmJOO8WxKOb+iH6eQup/U++Qt/XB80RX3f6SCQWYNvi4n/xtKgIBHStWPKyjU5pWDgrWgkiNwXhgMj+gczR1FYrBq/AzXO/+tWqhKMILuhE5ARu54tE= 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:(366004)(66476007)(76116006)(4326008)(66446008)(71200400001)(66556008)(64756008)(66946007)(186003)(26005)(6506007)(53546011)(52536014)(107886003)(5660300002)(8936002)(122000001)(38100700002)(82960400001)(2906002)(966005)(9686003)(508600001)(38070700005)(83380400001)(110136005)(316002)(54906003)(86362001)(55016003)(8676002)(33656002)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?njKnqGKLPh/UyT5xsGf7mkDLuWVdd0uM7N7bC3lwGfSB6qG34TKzkTbLYxyG?= =?us-ascii?Q?0K/+LoFzXjCupj7LnFMpj4+eEMC+TC5JBgbbaiXioNbNJ5m83F7ftU5B8nBp?= =?us-ascii?Q?EnKEypoQyi+fdAk2DT8264eo1xWb5084tqbjpUp8x+MqdpIPJ/R6K2Nkb+ke?= =?us-ascii?Q?At5JGZUQYqKDfTnDl2Ne0Uc3tIMG6jRFTeuDsB4uAiWkd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qOqFkp6QB3zjFv138SePctalqEqkR?= =?us-ascii?Q?o6l0tNsrW8uoRS/hXVI0OW602B/3+7xjLhDM64m3BllVlzJjVVbs0380TFWr?= =?us-ascii?Q?3myVCJFZc3qN7+UGfgW5pfQ/d8UbSASTfEFil44m10oL9uKEi3b7wBSYSXUP?= =?us-ascii?Q?dSW0t+/kKITvGNgTA0qYQBYMzK5f2bCh8zzTp2DG2xT+dv2Pz64cLAGS2mqc?= =?us-ascii?Q?NS/mAXUvFWYTJv+QGhs0Jl4VKhygkIIGDqMy7TADJnkFUvZSM1oAFeCN0+AA?= =?us-ascii?Q?+nMpaNMLxN/gCEWM9Dqm8fR+a32nZx5Zt6dTJGYJGmvSvC3Uw0wdVpe1G3pG?= =?us-ascii?Q?wJ5Fbbh+jRrUX4aUZ+B6OKl27x6cI1jccbBuAw7w+BCdh4lQJ30Vx1/fM8bt?= =?us-ascii?Q?2HdEL+isdO05yIGskkUdC61S0ubnGEfL2yQT9gOGEfhEL2nRPM3grRZgqnss?= =?us-ascii?Q?fohEuvpuE5Alyq4x6Gkuhw91dov9SBlv/v/PtZK4wxgDxpmmnd0d3uXWulvm?= =?us-ascii?Q?rKO381saRKkrcetTp/hDiNk=3D?= 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: 9a4ca4f0-1c9c-4148-fa63-08d9bedcbcfa X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2021 08:35:52.0876 (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: PcjvUYGq4/mDdSpMP0OLdtzX5DWgnnkBJ6snDrmzkw17LfGX6Lr25vCFgQ7emRQvDH0snvjv65vvIF+el5pHiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3449 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 Thanks for the patch. Generally, the change is good to me. A couple of minor inline comments belo= w: > -----Original Message----- > From: Ke, VincentX > Sent: Tuesday, December 14, 2021 2:50 PM > To: devel@edk2.groups.io > Cc: Ke, VincentX ; Wu, Hao A > ; Ni, Ray ; Chiu, Ian > ; Chu, Maggie > Subject: [PATCH] MdeModulePkg: Replace with UfsUnitDesc to fix response > timeout problem. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3714 >=20 > Replace with UFS_UNIT_DESC to fix response timeout problem. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Cc: Ian Chiu > Cc: Maggie Chu > Signed-off-by: VincentX Ke > --- > .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c > b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c > index b331c0f3e3..3a55348cac 100644 > --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c > +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c > @@ -1037,9 +1037,10 @@ InitializeUfsBlockIoPeim ( > UFS_PEIM_HC_PRIVATE_DATA *Private; > EDKII_UFS_HOST_CONTROLLER_PPI *UfsHcPpi; > UINT32 Index; > - UFS_CONFIG_DESC Config; > UINTN MmioBase; > UINT8 Controller; > + UFS_UNIT_DESC UnitDescriptor; > + UINT32 UnitDescriptorSize; >=20 > // > // Shadow this PEIM to run from memory @@ -1126,19 +1127,18 @@ > InitializeUfsBlockIoPeim ( > } >=20 > // > - // Get Ufs Device's Lun Info by reading Configuration Descriptor. > + // Check if 8 common luns are active and set corresponding bit mask. > // > - Status =3D UfsRwDeviceDesc (Private, TRUE, UfsConfigDesc, 0, 0, &Con= fig, > sizeof (UFS_CONFIG_DESC)); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "Ufs Get Configuration Descriptor Error, Stat= us > =3D %r\n", Status)); > - Controller++; > - continue; > - } > - > - for (Index =3D 0; Index < UFS_PEIM_MAX_LUNS; Index++) { > - if (Config.UnitDescConfParams[Index].LunEn !=3D 0) { > + UnitDescriptorSize =3D sizeof (UFS_UNIT_DESC); > + for (Index =3D 0; Index < 8; Index++) { Please help to use the macro "UFS_PEIM_MAX_LUNS" instead of using hardcode = value "8" in the above line. > + Status =3D UfsRwDeviceDesc (Private, TRUE, UfsUnitDesc, (UINT8) In= dex, 0, > &UnitDescriptor, UnitDescriptorSize); I think you can directly use "sizeof (UFS_UNIT_DESC)" in the above line and= not introducing the local variable "UnitDescriptorSize". > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "Failed to read unit descriptor, index =3D = %X, Failed to read unit descriptor -> Fail to read UFS Unit Descriptor > status =3D %r\n", Index, Status)); > + continue; > + } > + if (UnitDescriptor.LunEn =3D=3D 0x1) { > + DEBUG ((DEBUG_INFO, "UFS LUN %X is enabled\n", Index)); Please help to keep the controller index information in the above debug mes= sage as before. Best Regards, Hao Wu > Private->Luns.BitMask |=3D (BIT0 << Index); > - DEBUG ((DEBUG_INFO, "Ufs %d Lun %d is enabled\n", Controller, > Index)); > } > } >=20 > -- > 2.18.0.windows.1