)\r
{\r
EFI_STATUS Status;\r
+ EFI_BOOT_MODE BootMode;\r
EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI *NvmeHcPpi;\r
UINT8 Controller;\r
UINTN MmioBase;\r
\r
DEBUG ((DEBUG_INFO, "%a: Enters.\n", __FUNCTION__));\r
\r
+ //\r
+ // Get the current boot mode.\r
+ //\r
+ Status = PeiServicesGetBootMode (&BootMode);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__));\r
+ return Status;\r
+ }\r
+\r
//\r
// Locate the NVME host controller PPI\r
//\r
continue;\r
}\r
\r
+ //\r
+ // For S3 resume performance consideration, not all NVM Express controllers\r
+ // will be initialized. The driver consumes the content within\r
+ // S3StorageDeviceInitList LockBox to see if a controller will be skipped\r
+ // during S3 resume.\r
+ //\r
+ if ((BootMode == BOOT_ON_S3_RESUME) &&\r
+ (NvmeS3SkipThisController (DevicePath, DevicePathLength))) {\r
+ DEBUG ((\r
+ DEBUG_ERROR, "%a: Controller %d is skipped during S3.\n",\r
+ __FUNCTION__, Controller\r
+ ));\r
+ Controller++;\r
+ continue;\r
+ }\r
+\r
//\r
// Memory allocation for controller private data\r
//\r