public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
@ 2022-03-16 19:56 littlefox
  2022-03-19 22:30 ` [edk2-devel] " Mara Sophie Grosch
  0 siblings, 1 reply; 6+ messages in thread
From: littlefox @ 2022-03-16 19:56 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

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 9dd14fc ( https://github.com/tianocore/edk2/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

Patch is on GitHub: https://github.com/tianocore/edk2/pull/2637

$ git diff --stat master

MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

[-- Attachment #2: Type: text/html, Size: 2966 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
  2022-03-16 19:56 [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css littlefox
@ 2022-03-19 22:30 ` Mara Sophie Grosch
  2022-03-21  0:49   ` Wu, Hao A
  0 siblings, 1 reply; 6+ messages in thread
From: Mara Sophie Grosch @ 2022-03-19 22:30 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Jian J Wang, Liming Gao

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Hi,

sending again, because I forgot to CC reviewers.

Best regards,
Mara Sophie Grosch

Am Wed, Mar 16, 2022 at 12:56:25PM -0700 schrieb littlefox via groups.io:
>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 9dd14fc ( https://github.com/tianocore/edk2/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
>
>Patch is on GitHub: https://github.com/tianocore/edk2/pull/2637
>
>$ git diff --stat master
>
>MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-
>
>1 file changed, 1 insertion(+), 1 deletion(-)
>
>
>
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Wu, Hao A @ 2022-03-21  0:49 UTC (permalink / raw)
  To: devel@edk2.groups.io, littlefox@lf-net.org
  Cc: Ni, Ray, Wang, Jian J, Gao, Liming

Hello,

Could you help to follow the instructions at:
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process#the-developer-process-for-the-edk-ii-project
and send the patch mail to the edk2 mail list?

For the patch, could you help to refine the check to:
if ((Private->Cap.Css & BIT0) == 0) {

Thanks in advance.

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Mara
> Sophie Grosch via groups.io
> Sent: Sunday, March 20, 2022 6:31 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Wang, Jian
> J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check
> for Cap.Css
> 
> Hi,
> 
> sending again, because I forgot to CC reviewers.
> 
> Best regards,
> Mara Sophie Grosch
> 
> Am Wed, Mar 16, 2022 at 12:56:25PM -0700 schrieb littlefox via groups.io:
> >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 9dd14fc
> ( https://github.com/tianocore/edk2/commit/9dd14fc91c174eae87fd122c7ac7
> 0073a363527f ) , 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
> >
> >Patch is on GitHub: https://github.com/tianocore/edk2/pull/2637
> >
> >$ git diff --stat master
> >
> >MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-
> >
> >1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >
> >
> >
> >
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
  2022-03-21  0:49   ` Wu, Hao A
@ 2022-03-21 17:05     ` Mara Sophie Grosch
  2022-03-22  1:28       ` [edk2-devel] " Wu, Hao A
  0 siblings, 1 reply; 6+ messages in thread
From: Mara Sophie Grosch @ 2022-03-21 17:05 UTC (permalink / raw)
  To: devel, hao.a.wu

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
  2022-03-21 17:05     ` Mara Sophie Grosch
@ 2022-03-22  1:28       ` Wu, Hao A
  2022-03-22  1:44         ` Mara Sophie Grosch
  0 siblings, 1 reply; 6+ messages in thread
From: Wu, Hao A @ 2022-03-22  1:28 UTC (permalink / raw)
  To: devel@edk2.groups.io, littlefox@lf-net.org

The change is good to me.

Could you help to apply this change to the code in MdeModulePkg\Bus\Pci\NvmExpressPei\ as well?
Really sorry for missing the above comment in previous reply.

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Mara
> Sophie Grosch via groups.io
> Sent: Tuesday, March 22, 2022 1:06 AM
> To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>
> Subject: [edk2-devel] [PATCH] 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 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
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
  2022-03-22  1:28       ` [edk2-devel] " Wu, Hao A
@ 2022-03-22  1:44         ` Mara Sophie Grosch
  0 siblings, 0 replies; 6+ messages in thread
From: Mara Sophie Grosch @ 2022-03-22  1:44 UTC (permalink / raw)
  To: devel, hao.a.wu

Will do tomorrow (UTC+1), thanks for reviewing :)

Am 22. März 2022 01:28:45 UTC schrieb "Wu, Hao A" <hao.a.wu@intel.com>:
>The change is good to me.
>
>Could you help to apply this change to the code in MdeModulePkg\Bus\Pci\NvmExpressPei\ as well?
>Really sorry for missing the above comment in previous reply.
>
>Best Regards,
>Hao Wu
>
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Mara
>> Sophie Grosch via groups.io
>> Sent: Tuesday, March 22, 2022 1:06 AM
>> To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>
>> Subject: [edk2-devel] [PATCH] 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 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
>> 
>> 
>> 
>> 
>
>
>
>
>
>

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-22  1:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-03-22  1:28       ` [edk2-devel] " Wu, Hao A
2022-03-22  1:44         ` Mara Sophie Grosch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox