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.5479.1648427377802216357 for ; Sun, 27 Mar 2022 17:29:39 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Ivbg7PLh; 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=1648427377; x=1679963377; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=wWKmNWeDnMhcNpDAcRj4P+bEXzUgt1v9zHfQyAnbqck=; b=Ivbg7PLhHiQgMU8sAq6AQbDJjfB7zYivFmuyX8Gk+L2f2ofv9YwtWDBP EFB+XMpTU3O3lO3z2iqWHWfgtffEfcAsVHGr0AElwAmSBZtJptkzCO6I3 m50d6WQURYZcJEaF2kXgMwMH3WI1PafHzEylcSqie0yMMm6I8GXexftjQ 6apvzZybKYnYvbAFoiCZYT/TkgqrSJ6LvzAsUSADGnYQ/ryhm4dVSBPlF GgUrtnnSP74RatGUwaLYmfpLqqGV7P3vvVd9BCgfYnp8uveCD6AKmrYoK y4+neDU743HVXtr/C1eHioFQBb/Ct6s+Hy5fv22HoeBGojU09XocG8U1+ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10299"; a="322072408" X-IronPort-AV: E=Sophos;i="5.90,216,1643702400"; d="scan'208";a="322072408" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2022 17:29:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,216,1643702400"; d="scan'208";a="585007669" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga001.jf.intel.com with ESMTP; 27 Mar 2022 17:29:36 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 27 Mar 2022 17:29:36 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 27 Mar 2022 17:29:36 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Sun, 27 Mar 2022 17:29:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DkF9DLcKEFaTGbDl42ojLe6eWdlpNpo0b8eaYo2xWcnmmwCafnOZ3hU7PNMW/0E3mAX5Ymt12l1agwbBv4YF3LeWwKGar4R3MjB6BaGrr9ZczcWSHjOF/F/GpwTupNmpBepakcblATTFzjhwDV4a9wRXYdQzsTkJLOLJC5oUksSDGCuutlpEX5bZ4OWw9p2guIJ88oo6HReOW9WsqpuU62lCPcJo5CYMe2t9Umxne3lYwUGWZceBsSvof+R2FThv9ZwEqZsn4ZXFMfchuRs6HgkS5KC1TgFb+FCmxwAFzifK+xIZZEoxV1H5WOYxNfjzqYDXZmc6xXSnF6U2a+vozQ== 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=OczkBZxFijguUqP6BQzzkdCAiiZEPqCj8vYS2m4XjeI=; b=ZCXTZx+KRfS6hV/TwTM0vQSeLlNFLagjjqu0sS1pDf0mXadD4gUv49O0Nisnh7LXftO1f31agNfYVuXvepbiUzoMLYjigu6I95/VAHTDnxQ9go+2iURCLMAa+mgeDUpybQexdvaSK0AUTmxqL2ZSAmtHoUaZu257Q9lRKRhxom+/XKMAIHBNpy6+8eMYozBzbCcxAtPIqiLZWPDt0UU0/vrr0/LjrDmtEPc/ssPgbcXQxZhb7sSePkPF9OH0yBZ+VREUvrSADpJd//BXJW/u01kibePbb0nQltaVgOb5vaVRoNjk7nHNxVhB+3OawcgQjXgo4M/FftExcg5bApGcJA== 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 PH7PR11MB6055.namprd11.prod.outlook.com (2603:10b6:510:1d3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.19; Mon, 28 Mar 2022 00:29:34 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::7852:37e2:513c:470b]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::7852:37e2:513c:470b%7]) with mapi id 15.20.5102.022; Mon, 28 Mar 2022 00:29:34 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Bandaru, Purna Chandra Rao" CC: "Albecki, Mateusz" , "Gao, Liming" , "Liu, Zhiguang" Subject: Re: [edk2-devel] [PATCH] bRefClkFreq UFS card attribute need to be programmed after fDeviceInit Thread-Topic: [edk2-devel] [PATCH] bRefClkFreq UFS card attribute need to be programmed after fDeviceInit Thread-Index: AQHYQEJs/zcrMO2BuESmhQ6jEdDf0azT9PAg Date: Mon, 28 Mar 2022 00:29:34 +0000 Message-ID: References: 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-office365-filtering-correlation-id: 434b0568-8eb6-448d-5c3a-08da1052088e x-ms-traffictypediagnostic: PH7PR11MB6055:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F6bM5+VKgHujnrivaR7PKLnaguBFVcO7r7ug/eq/4//IyyDPzYbmDR58+i0TssVQrw+bDxt65Bhl85o7yeSOMYHWDoC+9uVy4Icp1UvbydNPu0ihS88yYfNYF5hhbMnfJGprbJvEYiVV1RFKTzcVPrWi4hL74f8sE+oaRHIB7hEpYynTMoay/j1oae0DgqqRLodNHmhxUwdm6ixr08i5KkJTDOFYYCP9JhyX+izUt0LSvgmMmJCE15Vlflz06pQWKH7K51WU80SWhmvh2Z5itYT2f3R1RLUPk9xFoewp5rUVYXdCGDsoMXJULewsOzEZDaJNJ0UMkilLHSaZ6+GJNaHAXV51M7fpf7LsTgrMUjWuiFqB8PY18LxHAGtBuLAAMg5nEjCFDxpSWBEgoPVHuPnGg3TWh/f1US6/0TnAzlzqmmT3g/ZTNhPcGqUQEq9Kj+38pnWEOGRpXSBFFRFdy6Vd6Wchqm4HbLF0CljzF4VGbXpzD81Mh1MnMg+Odib+WIIQquUupMYYBrMfjmMyHFFlq719yYMMbUDh3Stmk9/t35CZRdAyncVeAnz9PzOn23aEg3C3d5xjHSOwoEa7BlTC8Z4w21pye9mdctfZ917DaH4WTbHHLOG8T3DJVoUlAuIjjR0ILQMK+AQd0MGvz5L1V6TqqB0qhA/UWUP9uiAZ36KUsp4swo71e8JXtuhuMKCuFEndyj6BYnaqheauQ0IsgCkZVCESSuk5VptHaQTwzXM6LOP9yD7nT+Y/gFDLj0JcdLi3Drvkc7UqqbMoOZFCMKckcfwe/z1rDTGnsifGS7+3Or3OKjUPSECdknhVEujzOeebCRbyluwN0UjlpNVyjaWm1PXrVZxwH0MO2m4= 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:(13230001)(366004)(8676002)(4326008)(66946007)(66446008)(64756008)(76116006)(2906002)(7696005)(6506007)(966005)(107886003)(71200400001)(86362001)(33656002)(66556008)(508600001)(66476007)(55016003)(38100700002)(8936002)(83380400001)(6636002)(52536014)(5660300002)(9686003)(186003)(26005)(316002)(53546011)(82960400001)(110136005)(54906003)(38070700005)(122000001)(145543001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?k71D6nScHYhtLXosi9PsKMgMBTmNFRcSsQkxpXvhQmEKuAtEULH/ai9dqKv5?= =?us-ascii?Q?rH4x0EyXe6GS6tiIdA4+8ljFtzBT0FUujhVzaCNjFLYK39CnihEB3Z2xvYGG?= =?us-ascii?Q?DUUBt2FTaBv721AHGRMhnZugbd+MIY+SRxeWQB1qhT/8kj/MPfPNV/PlyZv0?= =?us-ascii?Q?fOjDOrmCpZyeHgtEV+bBvQ8A8sOdoC+22A8tXsB7iRsGRABcthnqxfvxgjRn?= =?us-ascii?Q?a/z+RoHlaqMtjtaP9Zr5WILvtl4Jr00dvmAUpbeZn1UX/lQnkEvHSYW0MTec?= =?us-ascii?Q?BZ+8P9k2amEtQjxS6opdV5UeMy6ocWL9P1Iid6dyl98rimg1IHQH/j+RAL8y?= =?us-ascii?Q?VaBAOD4WLn75wNC4I2OngQjpCCVoNJPWci8vYfnbNn3YfKV+e30UaMcI1UdN?= =?us-ascii?Q?FY147Gaf2QcPICuD/ogc9SrkiveooIJEWP0zwDrWBGAxsD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c/Clw3J7GNsCcd9i8TPSJ20zjIlk8GTVpqSbdXfH+nUVe?= =?us-ascii?Q?cFvxnAIsnRmDPAPhh+WdRHGX1Jvc+W+EHUSD3pmr85IXlZcIA0jWxVh6fNuu?= =?us-ascii?Q?dMRHo2/8WhCsvfUgplm/YJRGnxwsXsQAaICYtxcntnr46FuRzWDXtKKnAoQs?= =?us-ascii?Q?9ikhmSdZwowW5f6vFwsQfnq7mcnh4v8rea39SmNhtSzRtEtBMXgWkz3tMmXJ?= =?us-ascii?Q?aCzgKf5RGt5LOnUL5Ak9woitwaFBpTPS2bY6rK0I7Zzl4BvJVVXI4mD/F2u4?= =?us-ascii?Q?P2ZdJwh/1gvlST1TMzZ9N2ydZqvVI1HGAAMNldr7LfIjoByV6m2d5yXTNLXy?= =?us-ascii?Q?PRgbqbxR5jaVLixdghWSWA896Vnw2W0mHyGKi7U+2g8WagPv7pXsR2eg5cpO?= =?us-ascii?Q?xFeCApVVEA=3D=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: 434b0568-8eb6-448d-5c3a-08da1052088e X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2022 00:29:34.1850 (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: 3W36I3Dw9z+yFukB1HV+TSJAEzViV8fG3mHwAV0uP/sv+ZWQu2LKOjk4FxhvfrqJdtcLR6G3qCzY3hS0Yno6hg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6055 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 Will slightly modify the subject to: MdeModulePkg/Ufs: bRefClkFreq attribute be programmed after fDeviceInit Reviewed-by: Hao A Wu Will wait a day before merging to see if comment from other reviewers. Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Bandaru, > Purna Chandra Rao > Sent: Friday, March 25, 2022 8:18 PM > To: devel@edk2.groups.io > Cc: Bandaru, Purna Chandra Rao ; Wu, > Hao A ; Albecki, Mateusz ; > Gao, Liming ; Liu, Zhiguang > > Subject: [edk2-devel] [PATCH] bRefClkFreq UFS card attribute need to be > programmed after fDeviceInit >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3886 >=20 > bRefClkFreq UFS card attribute need to be read and written after successf= ul > fDeviceInit and NOP response so that link will be stable. >=20 > Cc: Wu Hao A > Cc: Albecki Mateusz > Cc: Liming Gao > Cc: Zhiguang Liu >=20 > Signed-off-by: Purna Chandra Rao Bandaru > > --- > .../Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 34 +++++++++---------- > 1 file changed, 17 insertions(+), 17 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > index dc78e09678..ae593ff03a 100644 > --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > @@ -919,6 +919,23 @@ UfsPassThruDriverBindingStart ( > goto Error; > } >=20 > + // > + // UFS 2.0 spec Section 13.1.3.3: > + // At the end of the UFS Interconnect Layer initialization on both > + host and device side, // the host shall send a NOP OUT UPIU to verify = that the > device UTP Layer is ready. > + // > + Status =3D UfsExecNopCmds (Private); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status > =3D %r\n", Status)); > + goto Error; > + } > + > + Status =3D UfsFinishDeviceInitialization (Private); if (EFI_ERROR > + (Status)) { > + DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status= =3D %r\n", > Status)); > + goto Error; > + } > + > if ((mUfsHcPlatform !=3D NULL) && > ((mUfsHcPlatform->RefClkFreq =3D=3D EdkiiUfsCardRefClkFreq19p2Mhz)= || > (mUfsHcPlatform->RefClkFreq =3D=3D EdkiiUfsCardRefClkFreq26Mhz) |= | @@ - > 967,23 +984,6 @@ UfsPassThruDriverBindingStart ( > } > } >=20 > - // > - // UFS 2.0 spec Section 13.1.3.3: > - // 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. > - // > - Status =3D UfsExecNopCmds (Private); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status > =3D %r\n", Status)); > - goto Error; > - } > - > - Status =3D UfsFinishDeviceInitialization (Private); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status= =3D %r\n", > Status)); > - goto Error; > - } > - > // > // Check if 8 common luns are active and set corresponding bit mask. > // > -- > 2.31.1.windows.1 >=20 >=20 >=20 >=20 >=20