From: "Chang, Abner" <abner.chang@amd.com>
To: <devel@edk2.groups.io>
Cc: <Kuei-Hung.Lin@amd.com>, Hao A Wu <hao.a.wu@intel.com>,
Ray Ni <ray.ni@intel.com>,
Garrett Kirkendall <garrett.kirkendall@amd.com>,
"Abner Chang" <abner.chang@amd.com>
Subject: [PATCH] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
Date: Sat, 10 Dec 2022 17:36:35 +0800 [thread overview]
Message-ID: <20221210093635.1186-1-abner.chang@amd.com> (raw)
From: Abner Chang <abner.chang@amd.com>
Initialize XHCI DCI slot's context entries value.
Signed-off-by: Kuei-Hung Lin <Kuei-Hung.Lin@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>
Signed-off-by: Abner Chang <abner.chang@amd.com>
---
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 ++++++
MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13b0400e83d..fecc19c50dc 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -2807,6 +2807,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 +3009,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..f2eaf0a4b73 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -1752,6 +1752,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 +1977,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
reply other threads:[~2022-12-10 9:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221210093635.1186-1-abner.chang@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox