public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chiu, Ian" <ian.chiu@intel.com>
To: devel@edk2.groups.io
Cc: Ian Chiu <ian.chiu@intel.com>, Hao A Wu <hao.a.wu@intel.com>,
	Ray Ni <ray.ni@intel.com>, More Shih <more.shih@intel.com>
Subject: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Increase 1ms extra delay for xHCI issue HCRST
Date: Thu, 14 Mar 2024 21:39:45 +0800	[thread overview]
Message-ID: <20240314133945.3018-1-ian.chiu@intel.com> (raw)

From: Ian Chiu <ian.chiu@intel.com>

https://bugzilla.tianocore.org/show_bug.cgi?id=4727

More and more XHCI host controllers require to have extra 1ms
delay before accessing any MMIO register during reset.

Since PHY transition from P3 to P0 can take around 1.3ms and
the xHCI reset can take around 1.5ms.

Hence, need delay increase between issuing HCRST on xHCI
controller till first MMIO read for reset completion check.

Cc: Hao A Wu     <hao.a.wu@intel.com>
Cc: Ray Ni       <ray.ni@intel.com>
Cc: More Shih    <more.shih@intel.com>
Signed-off-by: Ian Chiu <ian.chiu@intel.com>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index 40f2f1f227..eafe4b0d11 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -861,10 +861,11 @@ XhcResetHC (
     XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET);
     //
     // Some XHCI host controllers require to have extra 1ms delay before accessing any MMIO register during reset.
+    // PHY transition from P3 to P0 can take around 1.3ms and the xHCI reset can take around 1.5ms.
     // Otherwise there may have the timeout case happened.
-    // The below is a workaround to solve such problem.
+    // Stall for 2ms workaround to solve such problem.
     //
-    gBS->Stall (XHC_1_MILLISECOND);
+    gBS->Stall (XHC_1_MILLISECOND*2);
     Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);
 
     if (!EFI_ERROR (Status)) {
-- 
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116751): https://edk2.groups.io/g/devel/message/116751
Mute This Topic: https://groups.io/mt/104926466/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-03-14 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 13:39 Chiu, Ian [this message]
2024-03-28  1:12 ` 回复: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Increase 1ms extra delay for xHCI issue HCRST gaoliming via groups.io

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=20240314133945.3018-1-ian.chiu@intel.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