From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CAF422095DB90 for ; Wed, 9 Aug 2017 00:54:24 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2017 00:56:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,346,1498546800"; d="scan'208";a="117182670" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 09 Aug 2017 00:56:42 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 9 Aug 2017 00:56:42 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 9 Aug 2017 00:56:41 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.114]) by shsmsx102.ccr.corp.intel.com ([169.254.2.183]) with mapi id 14.03.0319.002; Wed, 9 Aug 2017 15:56:38 +0800 From: "Ni, Ruiyu" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH 0/2] Notify NVME HW when system reset happens Thread-Index: AQHTDy2+xJbUhNlu2kOhhDt5+dG3LqJ39RQAgAO2HUA= Date: Wed, 9 Aug 2017 07:56:37 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B9E30A7@SHSMSX104.ccr.corp.intel.com> References: <20170807033142.177248-1-ruiyu.ni@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 0/2] Notify NVME HW when system reset happens X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 07:54:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The NVME controller requires notification for shutdown as part of its manag= ement of internal structures. Even with FUA, failing to notify the NVME co= ntroller to shutdown power off causes the NVME controller to take quite som= e time to organize its tables on the next power on. This time exceeds the = normal timeout, so we would fail to boot the NVME disk.=20 I will put above explanation into the commit message as well. Thanks/Ray > -----Original Message----- > From: Wu, Hao A > Sent: Monday, August 7, 2017 3:14 PM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH 0/2] Notify NVME HW when system reset > happens >=20 > Hi Ray, >=20 > Just for curiosity, I checked the NVME spec for the purpose of a shutdown > notification to the controller when there is a power-off for the device. = And > found the following: >=20 > 1. Will increase the field 'Unsafe Shutdowns' in the SMART/Health > Information data (Section 5.10.1.2). >=20 > 2. Subsequent reads for locations written to the volatile write cache tha= t > were not written to non-volatile storage may return older data. (Section > 6.4.2.1) >=20 > For 2, the implementation of the NVME driver always sets the Force Unit > Access (FUA) bit for write operations. Hence, the read operation will ref= lect > the latest data on device. >=20 > So missing the shutdown notification will increase the number of 'Unsafe > Shutdowns' tracked by the controller. Is there any other issue being > introduced by missing the notification? >=20 > Besides, the change is good for me. >=20 >=20 > Best Regards, > Hao Wu >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Ruiyu Ni > > Sent: Monday, August 07, 2017 11:32 AM > > To: edk2-devel@lists.01.org > > Subject: [edk2] [PATCH 0/2] Notify NVME HW when system reset happens > > > > Per NVM Express Spec, software should notify NVME HW when shutdown > > occurs. > > > > The host should set the Shutdown Notification (CC.SHN) field to 01b to > > indicate a normal shutdown operation. The controller indicates when > > shutdown processing is completed by updating the Shutdown Status > > (CSTS.SHST) field to 10b. > > > > Ruiyu Ni (2): > > MdePkg/Nvme: Add NVME shutdown notification related macros > > MdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset > happens > > > > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c | 7 +- > > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h | 23 ++- > > .../Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf | 3 +- > > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 181 > > ++++++++++++++++++++- > > MdePkg/Include/IndustryStandard/Nvme.h | 6 +- > > 5 files changed, 215 insertions(+), 5 deletions(-) > > > > -- > > 2.12.2.windows.2 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel