<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi Hao</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">They are now resolved</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Sean</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 2 Dec 2022 at 06:25, Wu, Hao A <<a href="mailto:hao.a.wu@intel.com">hao.a.wu@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I saw there are several CI check failures for this 4 patches:<br>
<a href="https://github.com/tianocore/edk2/pull/3702" rel="noreferrer" target="_blank">https://github.com/tianocore/edk2/pull/3702</a><br>
<br>
Could you help to resolve them? Thanks.<br>
<br>
Best Regards,<br>
Hao Wu<br>
<br>
> -----Original Message-----<br>
> From: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>> On Behalf Of Sean<br>
> Rhodes<br>
> Sent: Friday, December 2, 2022 4:25 AM<br>
> To: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a><br>
> Cc: Matt DeVillier <<a href="mailto:matt.devillier@gmail.com" target="_blank">matt.devillier@gmail.com</a>>; Wu, Hao A<br>
> <<a href="mailto:hao.a.wu@intel.com" target="_blank">hao.a.wu@intel.com</a>>; Ni, Ray <<a href="mailto:ray.ni@intel.com" target="_blank">ray.ni@intel.com</a>>; Rhodes, Sean<br>
> <sean@starlabs.systems><br>
> Subject: [edk2-devel] [PATCH 1/4] MdeModulePkg/XhciDxe/XhciReg: Handle<br>
> incorrect PSIV indices<br>
> <br>
> From: Matt DeVillier <<a href="mailto:matt.devillier@gmail.com" target="_blank">matt.devillier@gmail.com</a>><br>
> <br>
> On some platforms, including Sky Lake and Kaby Lake, the PSIV (Protocol Speed<br>
> ID Value) indicesare shared between Protocol Speed ID DWORD' in the<br>
> extended capabilities registers for both USB2 (Full Speed) and USB3 (Super<br>
> Speed).<br>
> <br>
> An example can be found below:<br>
> <br>
>     XhcCheckUsbPortSpeedUsedPsic: checking for USB2 ext caps<br>
>     XhciPsivGetPsid: found 3 PSID entries<br>
>     XhciPsivGetPsid: looking for port speed 1<br>
>     XhciPsivGetPsid: PSIV 1 PSIE 2 PLT 0 PSIM 12<br>
>     XhciPsivGetPsid: PSIV 2 PSIE 1 PLT 0 PSIM 1500<br>
>     XhciPsivGetPsid: PSIV 3 PSIE 2 PLT 0 PSIM 480<br>
>     XhcCheckUsbPortSpeedUsedPsic: checking for USB3 ext caps<br>
>     XhciPsivGetPsid: found 3 PSID entries<br>
>     XhciPsivGetPsid: looking for port speed 1<br>
>     XhciPsivGetPsid: PSIV 1 PSIE 3 PLT 0 PSIM 5<br>
>     XhciPsivGetPsid: PSIV 2 PSIE 3 PLT 0 PSIM 10<br>
>     XhciPsivGetPsid: PSIV 34 PSIE 2 PLT 0 PSIM 1248<br>
> <br>
> The result is edk2 detecting USB2 devices as USB3 devices, which consequently<br>
> causes enumeration to fail.<br>
> <br>
> To avoid incorrect detection, check the extended capability registers for USB2<br>
> before USB3. If edk2 finds a match for a USB 2 device, don't check for USB 3.<br>
> <br>
> Cc: Hao A Wu <<a href="mailto:hao.a.wu@intel.com" target="_blank">hao.a.wu@intel.com</a>><br>
> Cc: Ray Ni <<a href="mailto:ray.ni@intel.com" target="_blank">ray.ni@intel.com</a>><br>
> Reviewed-by: Sean Rhodes <sean@starlabs.systems><br>
> Signed-off-by: Matt DeVillier <<a href="mailto:matt.devillier@gmail.com" target="_blank">matt.devillier@gmail.com</a>><br>
> Change-Id: I5bcf32105ce85fda95b4ba98a5e420e8f522374c<br>
> ---<br>
>  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 36 +++++++++++++++-----------<br>
> MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h |  1 +<br>
>  2 files changed, 22 insertions(+), 15 deletions(-)<br>
> <br>
> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c<br>
> b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c<br>
> index 2b4a4b2444..c992323443 100644<br>
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c<br>
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c<br>
> @@ -698,25 +698,11 @@ XhcCheckUsbPortSpeedUsedPsic (<br>
>    SpField.Dword = 0;   UsbSpeedIdMap = 0; -  //-  // Check xHCI Supported<br>
> Protocol Capability, find the PSIV field to match-  // PortSpeed definition when<br>
> the Major Revision is 03h.-  //-  if (Xhc->Usb3SupOffset != 0xFFFFFFFF) {-<br>
> SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpeed);-    if<br>
> (SpField.Dword != 0) {-      //-      // Found the corresponding PORTSC value in<br>
> PSIV field of USB3 offset.-      //-      UsbSpeedIdMap =<br>
> USB_PORT_STAT_SUPER_SPEED;-    }-  }-   //   // Check xHCI Supported Protocol<br>
> Capability, find the PSIV field to match   // PortSpeed definition when the Major<br>
> Revision is 02h.   //-  if ((UsbSpeedIdMap == 0) && (Xhc->Usb2SupOffset !=<br>
> 0xFFFFFFFF)) {+  if (Xhc->Usb2SupOffset != 0xFFFFFFFF) {     SpField.Dword =<br>
> XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpeed);     if (SpField.Dword != 0)<br>
> {       //@@ -733,6 +719,12 @@ XhcCheckUsbPortSpeedUsedPsic (<br>
>            // PSIM shows as default High-speed protocol, apply to High-speed<br>
> mapping           //           UsbSpeedIdMap =<br>
> USB_PORT_STAT_HIGH_SPEED;+        } else if (SpField.Data.Psim ==<br>
> XHC_SUPPORTED_PROTOCOL_USB2_FULL_SPEED_PSIM) {+          //+          //<br>
> PSIM shows as default Full-speed protocol, return 0+          // to ensure no port<br>
> status set+          //+          return 0;         }       } else if (SpField.Data.Psie == 1)<br>
> {         //@@ -750,6 +742,20 @@ XhcCheckUsbPortSpeedUsedPsic (<br>
>      }   } +  //+  // Check xHCI Supported Protocol Capability, find the PSIV field to<br>
> match+  // PortSpeed definition when the Major Revision is 03h.+  //+  if<br>
> ((UsbSpeedIdMap == 0) && (Xhc->Usb3SupOffset != 0xFFFFFFFF)) {+<br>
> SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpeed);+    if<br>
> (SpField.Dword != 0) {+      //+      // Found the corresponding PORTSC value in<br>
> PSIV field of USB3 offset.+      //+      UsbSpeedIdMap =<br>
> USB_PORT_STAT_SUPER_SPEED;+    }+  }+   return UsbSpeedIdMap; } diff --git<br>
> a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h<br>
> b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h<br>
> index 5fe2ba4f0e..74ac6297ba 100644<br>
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h<br>
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h<br>
> @@ -85,6 +85,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent<br>
>  #define XHC_SUPPORTED_PROTOCOL_DW2_OFFSET               0x08 #define<br>
> XHC_SUPPORTED_PROTOCOL_PSI_OFFSET               0x10 #define<br>
> XHC_SUPPORTED_PROTOCOL_USB2_HIGH_SPEED_PSIM     480+#define<br>
> XHC_SUPPORTED_PROTOCOL_USB2_FULL_SPEED_PSIM     12 #define<br>
> XHC_SUPPORTED_PROTOCOL_USB2_LOW_SPEED_PSIM      1500  #pragma<br>
> pack (1)--<br>
> 2.37.2<br>
> <br>
> <br>
> <br>
> -=-=-=-=-=-=<br>
> Groups.io Links: You receive all messages sent to this group.<br>
> View/Reply Online (#96843): <a href="https://edk2.groups.io/g/devel/message/96843" rel="noreferrer" target="_blank">https://edk2.groups.io/g/devel/message/96843</a><br>
> Mute This Topic: <a href="https://groups.io/mt/95391831/1768737" rel="noreferrer" target="_blank">https://groups.io/mt/95391831/1768737</a><br>
> Group Owner: <a href="mailto:devel%2Bowner@edk2.groups.io" target="_blank">devel+owner@edk2.groups.io</a><br>
> Unsubscribe: <a href="https://edk2.groups.io/g/devel/unsub" rel="noreferrer" target="_blank">https://edk2.groups.io/g/devel/unsub</a> [<a href="mailto:hao.a.wu@intel.com" target="_blank">hao.a.wu@intel.com</a>] -=-=-<br>
> =-=-=-=<br>
> <br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/96915">View/Reply Online (#96915)</a> |    |  <a target="_blank" href="https://groups.io/mt/95391831/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>