MdeModulePkg/NvmExpressDxe: fix check for Cap.Css

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 9dd14fc91c, 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>
This commit is contained in:
Mara Sophie Grosch via groups.io 2022-03-23 18:22:33 +08:00 committed by mergify[bot]
parent ec0b54849b
commit 5d8d8b5148
1 changed files with 1 additions and 1 deletions

View File

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