Re: [PATCH 1/3] MdeModulePkg/UfsPassThruDxe: Improve Device initialization polling Loop

Laszlo Ersek


can you tell us please why you (apparently) refuse to subscribe to this
list -- in spite of the two invites that I have sent you from the moderation WebUI?

You are creating unnecessary work for the moderators. They need to
approve your messages one by one, until you actually subscribe to the
list. It's only then that moderators can add you to the permanent
permit-list (i.e., permanently unmoderate you).

I've stopped approving your messages because you silently ignored
(apparently!) both invites that I generated for you. The latest of those
was sent on Feb 17. And that doesn't take into account any other invites
that other moderators may have sent you.

You are abusing the moderation system. Stop it. You are clearly a
recurring contributor, so subscribe already.

It's bad that I'm telling you this here, on the list, under your patch
set. However I also included a similarly detailed explanation/request
when I rejected your pending messages on Feb 17 (just before I would
send you my 2nd invite). You (apparently) completely ignored the
contents of that rejection message, you wouldn't subscribe, you have
just kept posting new patches since. I can't fathom your behavior.

In the same timeframe, I did the same to another contributor (rejected
their pending messages with a detailed explanation / request, and sent
them a 2nd invite too), and they *have* since subscribed. And now I
un-moderated them as well, ~5 minutes ago.

Do you actually *read* the emails that you receive? Or is your spam
filter mistrained?


On 02/22/21 18:02, Purna Chandra Rao Bandaru wrote:

Current Ufs Pass thru driver polls for 5us and return success even when
the timeout occurs.
There are cards that can take upto 600ms for Init and hence increased
the time out for fDeviceInit polling loop.

Signed-off-by: Bandaru <>
Cc: Mateusz Albecki <>
Cc: Ray Ni <>
Cc: Hao A Wu <>

Change-Id: I6cb063b43bdf37790db8e60c3919153cd2f3c086
MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index 9768c2e6fb..8859578af3 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
@@ -1,6 +1,6 @@
/** @file

- Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -749,7 +749,7 @@ UfsFinishDeviceInitialization (
UINT8 DeviceInitStatus;
- UINT8 Timeout;
+ UINT16 Timeout;

DeviceInitStatus = 0xFF;

@@ -761,17 +761,23 @@ UfsFinishDeviceInitialization (
return Status;

- Timeout = 5;
+ Timeout = 6000; //There are cards that can take upto 600ms.
do {
+ MicroSecondDelay (100); //Give 100 us and then start polling.
Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
if (EFI_ERROR (Status)) {
return Status;
- MicroSecondDelay (1);
} while (DeviceInitStatus != 0 && Timeout != 0);

- return EFI_SUCCESS;
+ if (Timeout == 0) {
+ DEBUG ((DEBUG_ERROR, "UfsFinishDeviceInitialization DeviceInitStatus=%x EFI_TIMEOUT \n", DeviceInitStatus));
+ return EFI_TIMEOUT;
+ } else {
+ DEBUG ((DEBUG_INFO, "UfsFinishDeviceInitialization Timeout left=%x EFI_SUCCESS \n", Timeout));
+ return EFI_SUCCESS;
+ }


Join to automatically receive all group messages.