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.web12.1051.1647882357401337969 for ; Mon, 21 Mar 2022 10:05:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@lf-net.org header.s=2021 header.b=tY+gppIZ; 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 4AC2C5FDB5; Mon, 21 Mar 2022 17:05:55 +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= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received; s=2021; t=1647882355; x= 1649696756; bh=mE1L8w/wQW9XJRPZ2WJsXWSUv80Ah4f57MmNMGpTWu8=; b=t Y+gppIZS7iTAgdmGOGImmJqJ7LkfQsuFHGF7V9wEZ4tssIyF99RFuDVhTQbcUT0D jKgBcbxNcGhDajSsyvT8IngQ0XzRO8WRY3gxrNp6b8ccWqMv2QyTYIzxMbG4h45b 14NC1CW+H2gyoZNhjPmz8EhJNGiFbIztR3Z+UGvqlaRX+Zfh/Sa7J5rHZju5Fe3p 9Yfq4agT03pUyF9xyUQOQ+O8ECBuM/I7ikAe3xyQYdsmhybV24ag1NHUkyPlZLLK REg4NzFG65Wk8IEFBN6rilFk5BdOGz6i1oCym/nDBl/EcCnYWzFLDAt9PGOSxeHC X2ltraVsPdaxQEJd4RcUA== 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 xRhCOt-c-DrA; Mon, 21 Mar 2022 17:05:55 +0000 (UTC) Received: from LF-T470 (unknown [IPv6:2001:16b8:5507:d001:529a:4cff:fed3:2f67]) by rondra.lf-net.org (Postfix) with ESMTPSA id 005E85FDB2; Mon, 21 Mar 2022 17:05:54 +0000 (UTC) Date: Mon, 21 Mar 2022 18:05:53 +0100 From: "Mara Sophie Grosch" To: devel@edk2.groups.io, hao.a.wu@intel.com Subject: [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css Message-ID: References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline 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/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