X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FPci%2FNvmExpressPei%2FNvmExpressPei.c;h=2dbf54fd3f0eaca88a0e43369339db7d6596bc43;hb=05fd2a926833;hp=bf33b4b9a03b9ff0b35b39c815513102761d3714;hpb=2e15b750c4b09896aca11188c8727eaf4888a1c0;p=mirror_edk2.git diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c index bf33b4b9a0..2dbf54fd3f 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c @@ -213,6 +213,7 @@ NvmExpressPeimEntry ( ) { EFI_STATUS Status; + EFI_BOOT_MODE BootMode; EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI *NvmeHcPpi; UINT8 Controller; UINTN MmioBase; @@ -223,6 +224,15 @@ NvmExpressPeimEntry ( DEBUG ((DEBUG_INFO, "%a: Enters.\n", __FUNCTION__)); + // + // Get the current boot mode. + // + Status = PeiServicesGetBootMode (&BootMode); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__)); + return Status; + } + // // Locate the NVME host controller PPI // @@ -279,6 +289,22 @@ NvmExpressPeimEntry ( continue; } + // + // For S3 resume performance consideration, not all NVM Express controllers + // will be initialized. The driver consumes the content within + // S3StorageDeviceInitList LockBox to see if a controller will be skipped + // during S3 resume. + // + if ((BootMode == BOOT_ON_S3_RESUME) && + (NvmeS3SkipThisController (DevicePath, DevicePathLength))) { + DEBUG (( + DEBUG_ERROR, "%a: Controller %d is skipped during S3.\n", + __FUNCTION__, Controller + )); + Controller++; + continue; + } + // // Memory allocation for controller private data //