From: Purna Chandra Rao Bandaru <purna.chandra.rao.bandaru@intel.com>
To: devel@edk2.groups.io
Cc: Purna Chandra Rao Bandaru <purna.chandra.rao.bandaru@intel.com>,
Mateusz Albecki <mateusz.albecki@intel.com>,
Ray Ni <ray.ni@intel.com>, Hao A Wu <hao.a.wu@intel.com>
Subject: [PATCH 3/3] MdeModulePkg/UfsPassThruDxe: Improve UFS device Readiness check.
Date: Mon, 22 Feb 2021 22:32:36 +0530 [thread overview]
Message-ID: <20210222170236.6312-3-purna.chandra.rao.bandaru@intel.com> (raw)
In-Reply-To: <20210222170236.6312-1-purna.chandra.rao.bandaru@intel.com>
https://bugzilla.tianocore.org/show_bug.cgi?id=3217
Retry sending NOP OUT command upto 10 times. This to give extra time for
UFS device to respond if was busy.
Signed-off-by: Bandaru <purna.chandra.rao.bandaru@intel.com>
Cc: Mateusz Albecki <mateusz.albecki@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Change-Id: I46054ea9ee34ad295fce58dff1756241fd22e17c
---
MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index 8859578af3..c4c2b03e46 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
@@ -911,9 +911,19 @@ UfsPassThruDriverBindingStart (
// At the end of the UFS Interconnect Layer initialization on both host and device side,
// the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
//
- Status = UfsExecNopCmds (Private);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));
+ for (Index = 10; Index > 0; Index--) {
+ Status = UfsExecNopCmds (Private);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Index = %x Status = %r\n", Index, Status));
+ MicroSecondDelay (100); //100 us
+ continue;
+ } else {
+ DEBUG ((DEBUG_INFO, "Ufs Sent NOP OUT successfully and received NOP IN, Status = %r\n", Status));
+ break;
+ }
+ }
+ if (!Index) {
+ DEBUG ((DEBUG_INFO, "NOP OUT failed all the 10 times Status = %r\n", Status));
goto Error;
}
--
2.16.2.windows.1
next prev parent reply other threads:[~2021-02-22 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 17:02 [PATCH 1/3] MdeModulePkg/UfsPassThruDxe: Improve Device initialization polling Loop Purna Chandra Rao Bandaru
2021-02-22 17:02 ` [PATCH 2/3] MdeModulePkg/UfsPassThruDxe: Improve Error handling of Ufs Pass Thru driver Purna Chandra Rao Bandaru
2021-02-22 17:02 ` Purna Chandra Rao Bandaru [this message]
2021-02-23 17:50 ` [edk2-devel] [PATCH 1/3] MdeModulePkg/UfsPassThruDxe: Improve Device initialization polling Loop Laszlo Ersek
2021-02-24 4:16 ` purna.chandra.rao.bandaru
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=20210222170236.6312-3-purna.chandra.rao.bandaru@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