From: "Mara Sophie Grosch" <littlefox@lf-net.org>
To: devel@edk2.groups.io, hao.a.wu@intel.com
Subject: [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
Date: Mon, 21 Mar 2022 18:05:53 +0100 [thread overview]
Message-ID: <YjiwcXzlTYA2QdoW@LF-T470> (raw)
In-Reply-To: <DM6PR11MB40252377BB395D92C6DACBEECA169@DM6PR11MB4025.namprd11.prod.outlook.com>
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>
---
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
index d87212ffb2..b90c48731c 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -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;
}
--
2.35.1
next prev parent reply other threads:[~2022-03-21 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 19:56 [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css littlefox
2022-03-19 22:30 ` [edk2-devel] " Mara Sophie Grosch
2022-03-21 0:49 ` Wu, Hao A
2022-03-21 17:05 ` Mara Sophie Grosch [this message]
2022-03-22 1:28 ` Wu, Hao A
2022-03-22 1:44 ` Mara Sophie Grosch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YjiwcXzlTYA2QdoW@LF-T470 \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox