public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
@ 2023-01-11  3:10 Chang, Abner
  2023-01-11  3:10 ` [PATCH V2 2/3] MdeModulePkg/Usb: Read a large number of blocks Chang, Abner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chang, Abner @ 2023-01-11  3:10 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Garrett Kirkendall, Abner Chang, Kuei-Hung Lin

From: Abner Chang <abner.chang@amd.com>

Initialize XHCI DCI slot's context entries value.

Signed-off-by: Jiangang He <jiangang.he@amd.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 7 +++++++
 MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13247f7b0df..4b7462704a8 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -4,6 +4,7 @@
 
 Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>
 Copyright (c) Microsoft Corporation.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -2807,6 +2808,9 @@ XhcInitializeEndpointContext (
   MaxDci = 0;
 
   NumEp = IfDesc->NumEndpoints;
+  if (NumEp == 0) {
+    MaxDci = 1;
+  }
 
   EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
   for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -3006,6 +3010,9 @@ XhcInitializeEndpointContext64 (
   MaxDci = 0;
 
   NumEp = IfDesc->NumEndpoints;
+  if (NumEp == 0) {
+    MaxDci = 1;
+  }
 
   EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
   for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
index cc597a43717..8400c90f7ad 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
 which is used to enable recovery function from USB Drivers.
 
 Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -1752,6 +1753,9 @@ XhcPeiSetConfigCmd (
     }
 
     NumEp = IfDesc->NumEndpoints;
+    if ((NumEp == 0) && (MaxDci == 0)) {
+      MaxDci = 1;
+    }
 
     EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
     for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -1974,6 +1978,9 @@ XhcPeiSetConfigCmd64 (
     }
 
     NumEp = IfDesc->NumEndpoints;
+    if ((NumEp == 0) && (MaxDci == 0)) {
+      MaxDci = 1;
+    }
 
     EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
     for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
-- 
2.37.1.windows.1


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

* [PATCH V2 2/3] MdeModulePkg/Usb: Read a large number of blocks
  2023-01-11  3:10 [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Chang, Abner
@ 2023-01-11  3:10 ` Chang, Abner
  2023-01-11  3:10 ` [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Chang, Abner
  2023-01-16  2:40 ` [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Wu, Hao A
  2 siblings, 0 replies; 6+ messages in thread
From: Chang, Abner @ 2023-01-11  3:10 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Garrett Kirkendall, Abner Chang, Kuei-Hung Lin

From: Abner Chang <abner.chang@amd.com>

Changes to allow reading blocks that greater than 65535 sectors.

Signed-off-by: Jiangang He <jiangang.he@amd.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c | 25 +++++++++++------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c
index 422ac5fec99..5111e4579e2 100644
--- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c
+++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c
@@ -2,6 +2,7 @@
 Pei USB ATAPI command implementations.
 
 Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -382,14 +383,14 @@ PeiUsbRead10 (
   ATAPI_PACKET_COMMAND  Packet;
   ATAPI_READ10_CMD      *Read10Packet;
   UINT16                MaxBlock;
-  UINT16                BlocksRemaining;
-  UINT16                SectorCount;
+  UINT32                BlocksRemaining;
+  UINT32                SectorCount;
   UINT32                Lba32;
   UINT32                BlockSize;
   UINT32                ByteCount;
   VOID                  *PtrBuffer;
   EFI_STATUS            Status;
-  UINT16                TimeOut;
+  UINT32                TimeOut;
 
   //
   // prepare command packet for the Inquiry Packet Command.
@@ -401,16 +402,13 @@ PeiUsbRead10 (
 
   BlockSize = (UINT32)PeiBotDevice->Media.BlockSize;
 
-  MaxBlock        = (UINT16)(65535 / BlockSize);
-  BlocksRemaining = (UINT16)NumberOfBlocks;
+  MaxBlock = (UINT16)(MAX_UINT16 / BlockSize);
+  ASSERT (NumberOfBlocks < MAX_UINT32);
+  BlocksRemaining = (UINT32)NumberOfBlocks;
 
   Status = EFI_SUCCESS;
   while (BlocksRemaining > 0) {
-    if (BlocksRemaining <= MaxBlock) {
-      SectorCount = BlocksRemaining;
-    } else {
-      SectorCount = MaxBlock;
-    }
+    SectorCount = MIN (BlocksRemaining, MaxBlock);
 
     //
     // fill the Packet data structure
@@ -435,7 +433,7 @@ PeiUsbRead10 (
 
     ByteCount = SectorCount * BlockSize;
 
-    TimeOut = (UINT16)(SectorCount * 2000);
+    TimeOut = SectorCount * 2000;
 
     //
     // send command packet
@@ -448,16 +446,17 @@ PeiUsbRead10 (
                (VOID *)PtrBuffer,
                ByteCount,
                EfiUsbDataIn,
-               TimeOut
+               (UINT16)MIN (TimeOut, MAX_UINT16)
                );
 
     if (Status != EFI_SUCCESS) {
       return Status;
     }
 
+    ASSERT (Lba32 <= (MAX_UINT32-SectorCount));
     Lba32          += SectorCount;
     PtrBuffer       = (UINT8 *)PtrBuffer + SectorCount * BlockSize;
-    BlocksRemaining = (UINT16)(BlocksRemaining - SectorCount);
+    BlocksRemaining = BlocksRemaining - SectorCount;
   }
 
   return Status;
-- 
2.37.1.windows.1


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

* [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block
  2023-01-11  3:10 [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Chang, Abner
  2023-01-11  3:10 ` [PATCH V2 2/3] MdeModulePkg/Usb: Read a large number of blocks Chang, Abner
@ 2023-01-11  3:10 ` Chang, Abner
  2023-01-13  8:26   ` [edk2-devel] " Wu, Hao A
  2023-01-16  2:40 ` [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Wu, Hao A
  2 siblings, 1 reply; 6+ messages in thread
From: Chang, Abner @ 2023-01-11  3:10 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Garrett Kirkendall, Abner Chang, Kuei-Hung Lin

From: Abner Chang <abner.chang@amd.com>

Unlink the XhciPei memory block when it has been freed.

Signed-off-by: Jiangang He <jiangang.he@amd.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
---
 MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 31 +++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
index c64b38fcfc8..e779a311388 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
@@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
 which is used to enable recovery function from USB Drivers.
 
 Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -365,6 +366,32 @@ UsbHcInitMemPool (
   return Pool;
 }
 
+/**
+  Unlink the memory block from the pool's list.
+
+  @param  Head           The block list head of the memory's pool.
+  @param  BlockToUnlink  The memory block to unlink.
+
+**/
+VOID
+UsbHcUnlinkMemBlock (
+  IN USBHC_MEM_BLOCK  *Head,
+  IN USBHC_MEM_BLOCK  *BlockToUnlink
+  )
+{
+  USBHC_MEM_BLOCK  *Block;
+
+  ASSERT ((Head != NULL) && (BlockToUnlink != NULL));
+
+  for (Block = Head; Block != NULL; Block = Block->Next) {
+    if (Block->Next == BlockToUnlink) {
+      Block->Next         = BlockToUnlink->Next;
+      BlockToUnlink->Next = NULL;
+      break;
+    }
+  }
+}
+
 /**
   Release the memory management pool.
 
@@ -386,7 +413,7 @@ UsbHcFreeMemPool (
   // first block.
   //
   for (Block = Pool->Head->Next; Block != NULL; Block = Pool->Head->Next) {
-    // UsbHcUnlinkMemBlock (Pool->Head, Block);
+    UsbHcUnlinkMemBlock (Pool->Head, Block);
     UsbHcFreeMemBlock (Pool, Block);
   }
 
@@ -532,7 +559,7 @@ UsbHcFreeMem (
   // Release the current memory block if it is empty and not the head
   //
   if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {
-    // UsbHcUnlinkMemBlock (Head, Block);
+    UsbHcUnlinkMemBlock (Head, Block);
     UsbHcFreeMemBlock (Pool, Block);
   }
 }
-- 
2.37.1.windows.1


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

* Re: [edk2-devel] [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block
  2023-01-11  3:10 ` [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Chang, Abner
@ 2023-01-13  8:26   ` Wu, Hao A
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Hao A @ 2023-01-13  8:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, abner.chang@amd.com
  Cc: Ni, Ray, Garrett Kirkendall, Kuei-Hung Lin

Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> Abner via groups.io
> Sent: Wednesday, January 11, 2023 11:10 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Garrett
> Kirkendall <garrett.kirkendall@amd.com>; Abner Chang
> <abner.chang@amd.com>; Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> Subject: [edk2-devel] [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei
> memory block
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> Unlink the XhciPei memory block when it has been freed.
> 
> Signed-off-by: Jiangang He <jiangang.he@amd.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> ---
>  MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 31
> +++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> index c64b38fcfc8..e779a311388 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on
> gPeiUsbControllerPpiGuid
>  which is used to enable recovery function from USB Drivers.
> 
>  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
> +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -365,6 +366,32 @@ UsbHcInitMemPool (
>    return Pool;
>  }
> 
> +/**
> +  Unlink the memory block from the pool's list.
> +
> +  @param  Head           The block list head of the memory's pool.
> +  @param  BlockToUnlink  The memory block to unlink.
> +
> +**/
> +VOID
> +UsbHcUnlinkMemBlock (
> +  IN USBHC_MEM_BLOCK  *Head,
> +  IN USBHC_MEM_BLOCK  *BlockToUnlink
> +  )
> +{
> +  USBHC_MEM_BLOCK  *Block;
> +
> +  ASSERT ((Head != NULL) && (BlockToUnlink != NULL));
> +
> +  for (Block = Head; Block != NULL; Block = Block->Next) {
> +    if (Block->Next == BlockToUnlink) {
> +      Block->Next         = BlockToUnlink->Next;
> +      BlockToUnlink->Next = NULL;
> +      break;
> +    }
> +  }
> +}
> +
>  /**
>    Release the memory management pool.
> 
> @@ -386,7 +413,7 @@ UsbHcFreeMemPool (
>    // first block.
>    //
>    for (Block = Pool->Head->Next; Block != NULL; Block = Pool->Head->Next) {
> -    // UsbHcUnlinkMemBlock (Pool->Head, Block);
> +    UsbHcUnlinkMemBlock (Pool->Head, Block);
>      UsbHcFreeMemBlock (Pool, Block);
>    }
> 
> @@ -532,7 +559,7 @@ UsbHcFreeMem (
>    // Release the current memory block if it is empty and not the head
>    //
>    if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {
> -    // UsbHcUnlinkMemBlock (Head, Block);
> +    UsbHcUnlinkMemBlock (Head, Block);
>      UsbHcFreeMemBlock (Pool, Block);
>    }
>  }
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
  2023-01-11  3:10 [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Chang, Abner
  2023-01-11  3:10 ` [PATCH V2 2/3] MdeModulePkg/Usb: Read a large number of blocks Chang, Abner
  2023-01-11  3:10 ` [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Chang, Abner
@ 2023-01-16  2:40 ` Wu, Hao A
  2023-01-16  2:41   ` Chang, Abner
  2 siblings, 1 reply; 6+ messages in thread
From: Wu, Hao A @ 2023-01-16  2:40 UTC (permalink / raw)
  To: devel@edk2.groups.io, abner.chang@amd.com
  Cc: Ni, Ray, Garrett Kirkendall, Kuei-Hung Lin

The 3-patch series is merged via:
PR - https://github.com/tianocore/edk2/pull/3899
Commits - 7cd55f300915...47ab397011b6:
https://github.com/tianocore/edk2/commit/8147fe090fb566f9a1ed8fde24098bbe425026be
https://github.com/tianocore/edk2/commit/be8d6ef3856fac2e64e23847a8f05d37822b1f14
https://github.com/tianocore/edk2/commit/47ab397011b6d1ce4d5805117dc87d9e35f378db

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> Abner via groups.io
> Sent: Wednesday, January 11, 2023 11:10 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Garrett
> Kirkendall <garrett.kirkendall@amd.com>; Abner Chang
> <abner.chang@amd.com>; Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> Subject: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI
> slot's Context value
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> Initialize XHCI DCI slot's context entries value.
> 
> Signed-off-by: Jiangang He <jiangang.he@amd.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 7 +++++++
>  MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 7 +++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> index 13247f7b0df..4b7462704a8 100644
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> @@ -4,6 +4,7 @@
> 
>  Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>
>  Copyright (c) Microsoft Corporation.<BR>
> +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -2807,6 +2808,9 @@ XhcInitializeEndpointContext (
>    MaxDci = 0;
> 
>    NumEp = IfDesc->NumEndpoints;
> +  if (NumEp == 0) {
> +    MaxDci = 1;
> +  }
> 
>    EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
>    for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
> @@ -3006,6 +3010,9 @@ XhcInitializeEndpointContext64 (
>    MaxDci = 0;
> 
>    NumEp = IfDesc->NumEndpoints;
> +  if (NumEp == 0) {
> +    MaxDci = 1;
> +  }
> 
>    EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
>    for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> index cc597a43717..8400c90f7ad 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on
> gPeiUsbControllerPpiGuid
>  which is used to enable recovery function from USB Drivers.
> 
>  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -1752,6 +1753,9 @@ XhcPeiSetConfigCmd (
>      }
> 
>      NumEp = IfDesc->NumEndpoints;
> +    if ((NumEp == 0) && (MaxDci == 0)) {
> +      MaxDci = 1;
> +    }
> 
>      EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
>      for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
> @@ -1974,6 +1978,9 @@ XhcPeiSetConfigCmd64 (
>      }
> 
>      NumEp = IfDesc->NumEndpoints;
> +    if ((NumEp == 0) && (MaxDci == 0)) {
> +      MaxDci = 1;
> +    }
> 
>      EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
>      for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
  2023-01-16  2:40 ` [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Wu, Hao A
@ 2023-01-16  2:41   ` Chang, Abner
  0 siblings, 0 replies; 6+ messages in thread
From: Chang, Abner @ 2023-01-16  2:41 UTC (permalink / raw)
  To: Wu, Hao A, devel@edk2.groups.io
  Cc: Ni, Ray, Kirkendall, Garrett, Lin, Kuei-Hung (Timothy)

[AMD Official Use Only - General]

Thanks Hao

Abner

> -----Original Message-----
> From: Wu, Hao A <hao.a.wu@intel.com>
> Sent: Monday, January 16, 2023 10:41 AM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
> Cc: Ni, Ray <ray.ni@intel.com>; Kirkendall, Garrett
> <Garrett.Kirkendall@amd.com>; Lin, Kuei-Hung (Timothy) <Kuei-
> Hung.Lin@amd.com>
> Subject: RE: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI
> DCI slot's Context value
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> The 3-patch series is merged via:
> PR - https://github.com/tianocore/edk2/pull/3899
> Commits - 7cd55f300915...47ab397011b6:
> https://github.com/tianocore/edk2/commit/8147fe090fb566f9a1ed8fde2409
> 8bbe425026be
> https://github.com/tianocore/edk2/commit/be8d6ef3856fac2e64e23847a8f0
> 5d37822b1f14
> https://github.com/tianocore/edk2/commit/47ab397011b6d1ce4d5805117dc
> 87d9e35f378db
> 
> Best Regards,
> Hao Wu
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> > Abner via groups.io
> > Sent: Wednesday, January 11, 2023 11:10 AM
> > To: devel@edk2.groups.io
> > Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > Garrett Kirkendall <garrett.kirkendall@amd.com>; Abner Chang
> > <abner.chang@amd.com>; Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> > Subject: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI
> > DCI slot's Context value
> >
> > From: Abner Chang <abner.chang@amd.com>
> >
> > Initialize XHCI DCI slot's context entries value.
> >
> > Signed-off-by: Jiangang He <jiangang.he@amd.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
> > Cc: Abner Chang <abner.chang@amd.com>
> > Cc: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
> > Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> > ---
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 7 +++++++
> > MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 7 +++++++
> >  2 files changed, 14 insertions(+)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > index 13247f7b0df..4b7462704a8 100644
> > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > @@ -4,6 +4,7 @@
> >
> >  Copyright (c) 2011 - 2020, Intel Corporation. All rights
> > reserved.<BR>  Copyright (c) Microsoft Corporation.<BR>
> > +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
> > +reserved.<BR>
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> > @@ -2807,6 +2808,9 @@ XhcInitializeEndpointContext (
> >    MaxDci = 0;
> >
> >    NumEp = IfDesc->NumEndpoints;
> > +  if (NumEp == 0) {
> > +    MaxDci = 1;
> > +  }
> >
> >    EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
> >    for (EpIndex = 0; EpIndex < NumEp; EpIndex++) { @@ -3006,6 +3010,9
> > @@ XhcInitializeEndpointContext64 (
> >    MaxDci = 0;
> >
> >    NumEp = IfDesc->NumEndpoints;
> > +  if (NumEp == 0) {
> > +    MaxDci = 1;
> > +  }
> >
> >    EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
> >    for (EpIndex = 0; EpIndex < NumEp; EpIndex++) { diff --git
> > a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> > b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> > index cc597a43717..8400c90f7ad 100644
> > --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> > +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
> > @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based
> on
> > gPeiUsbControllerPpiGuid  which is used to enable recovery function
> > from USB Drivers.
> >
> >  Copyright (c) 2014 - 2017, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
> > +reserved.<BR>
> >
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -1752,6 +1753,9 @@ XhcPeiSetConfigCmd (
> >      }
> >
> >      NumEp = IfDesc->NumEndpoints;
> > +    if ((NumEp == 0) && (MaxDci == 0)) {
> > +      MaxDci = 1;
> > +    }
> >
> >      EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
> >      for (EpIndex = 0; EpIndex < NumEp; EpIndex++) { @@ -1974,6
> > +1978,9 @@ XhcPeiSetConfigCmd64 (
> >      }
> >
> >      NumEp = IfDesc->NumEndpoints;
> > +    if ((NumEp == 0) && (MaxDci == 0)) {
> > +      MaxDci = 1;
> > +    }
> >
> >      EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
> >      for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
> > --
> > 2.37.1.windows.1
> >
> >
> >
> > 
> >

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

end of thread, other threads:[~2023-01-16  2:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11  3:10 [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Chang, Abner
2023-01-11  3:10 ` [PATCH V2 2/3] MdeModulePkg/Usb: Read a large number of blocks Chang, Abner
2023-01-11  3:10 ` [PATCH V2 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Chang, Abner
2023-01-13  8:26   ` [edk2-devel] " Wu, Hao A
2023-01-16  2:40 ` [edk2-devel] [PATCH V2 1/3] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Wu, Hao A
2023-01-16  2:41   ` Chang, Abner

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