]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg: Correct high-memory use in NvmExpressDxe
authorTomas Pilar <quic_tpilar@quicinc.com>
Thu, 24 Feb 2022 16:22:19 +0000 (16:22 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 28 Feb 2022 10:17:39 +0000 (10:17 +0000)
commitb1b89f9009f2390652e0061bd7b24fc40732bc70
treedb78ab8604fbf46f644899f9135aa08909a0835b
parentf1d1c337e7c0575da7fd248b2dd9cffc755940df
MdeModulePkg: Correct high-memory use in NvmExpressDxe

Move the logic that stores starting PCI attributes and sets the
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute to
DriverBindingStart() before the memory that backs the
DMA engine is allocated.

This ensures that the DMA-backing memory is not forcibly allocated
below 4G in system address map. Otherwise the allocation fails on
platforms that do not have any memory below the 4G mark and the drive
initialisation fails.

Leave the PCI device enabling attribute logic in NvmeControllerInit()
to ensure that the device is re-enabled on reset in case it was
disabled via PCI attributes.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Tomas Pilar <quic_tpilar@quicinc.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c