From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rondra.lf-net.org (rondra.lf-net.org [188.68.36.203]) by mx.groups.io with SMTP id smtpd.web11.7463.1648030964124596709 for ; Wed, 23 Mar 2022 03:22:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@lf-net.org header.s=2021 header.b=z2zUhzym; spf=pass (domain: lf-net.org, ip: 188.68.36.203, mailfrom: littlefox@lf-net.org) Received: from localhost (localhost [127.0.0.1]) by rondra.lf-net.org (Postfix) with ESMTP id A7DD85FDB6; Wed, 23 Mar 2022 10:22:42 +0000 (UTC) Authentication-Results: rondra.lf-net.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=lf-net.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lf-net.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=2021; t=1648030962; x=1649845363; bh=YeZin MI2nLxvkWMcKkLG0tpCHtk8m7xKGNMHl2echo0=; b=z2zUhzym7fMSqR0wdJYu4 ZZOUYBaALU2mTGfUuwGWbN50exsKDUSK4w2RrteGdoXAJcd0IwNix6c89tW4Uagp CEFaroWNuwMFdVG3ByCsrNCgBXXUZ5EB7IZWjTZGAOOsQ2s6z9eei0IvTITtyiW5 FsxHbl4wDHwUZkBxJQ/U7/roJLMCankQJxUwMe/EmxJCtb/B4zAn6bFOM3h9/s96 NZUJOrtO0Q2ktDxhFoQIoCg43pAisH/1xLtgR/lTK4HCzWcBGAVIrIbvpe5xWmeP Nsk653uH2GPXxShalAc6mVyqlPywHmLNpzh2GedRg6TbyyHIpuGuwhBIig8xANQu Q== X-Virus-Scanned: Debian amavisd-new at rondra.lf-net.org Received: from rondra.lf-net.org ([127.0.0.1]) by localhost (rondra.lf-net.org [127.0.0.1]) (amavisd-new, port 10026) with LMTP id eoEcp7woUb7r; Wed, 23 Mar 2022 10:22:42 +0000 (UTC) Received: from LF-T470.home.lf-net.dn42 (unknown [IPv6:2001:16b8:5549:3f01:4a51:c5ff:fe7a:408b]) by rondra.lf-net.org (Postfix) with ESMTPSA id E1B4C5FDB2; Wed, 23 Mar 2022 10:22:41 +0000 (UTC) From: "Mara Sophie Grosch" To: devel@edk2.groups.io Cc: hao.a.wu@intel.com, Mara Sophie Grosch Subject: [PATCH v2 1/2] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css Date: Wed, 23 Mar 2022 11:22:33 +0100 Message-Id: <5cae05f846015b8316e47c500ce8650b92365411.1648029370.git.littlefox@lf-net.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: <16DE909798871558.18232@groups.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModule= Pkg/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;=0D }=0D =0D - if (Private->Cap.Css !=3D 0x01) {=0D + if ((Private->Cap.Css & BIT0) =3D=3D 0) {=0D DEBUG ((DEBUG_INFO, "NvmeControllerInit: the controller doesn't suppor= t NVMe command set\n"));=0D return EFI_UNSUPPORTED;=0D }=0D --=20 2.35.1