]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
authorMara Sophie Grosch via groups.io <littlefox=lf-net.org@groups.io>
Wed, 23 Mar 2022 10:22:33 +0000 (18:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 25 Mar 2022 00:59:04 +0000 (00:59 +0000)
Fix the check for NVMe command set being supported by the controller.

Was problematic with qemu (6.2.0, Debian 1:6.2+dfsg-3), which sets 0xC1
in that register, making the OVMF think the NVMe controller does not
support NVMe.

Uncovered by commit 9dd14fc91c174eae87fd122c7ac70073a363527f, which
changed the number of bits included in the Css register from 4 to 8.

Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c

index d87212ffb268ad12cc8a4a039b691001ed126928..b90c48731ca1824dd1a71268dd3ef77294ddd778 100644 (file)
@@ -761,7 +761,7 @@ NvmeControllerInit (
     return Status;\r
   }\r
 \r
-  if (Private->Cap.Css != 0x01) {\r
+  if ((Private->Cap.Css & BIT0) == 0) {\r
     DEBUG ((DEBUG_INFO, "NvmeControllerInit: the controller doesn't support NVMe command set\n"));\r
     return EFI_UNSUPPORTED;\r
   }\r