Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,8 @@ UfsDeviceDetection (
for (Retry = 0; Retry < 3; Retry++) {
Status = UfsExecUicCommands (Private, UfsUicDmeLinkStartup, 0, 0, 0);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
DEBUG ((DEBUG_ERROR, "[%a] UfsExecUicCommands failed with Status=%r\n", __func__, Status));
continue;
}

//
Expand All @@ -1567,7 +1568,8 @@ UfsDeviceDetection (
Address = Private->UfsHcBase + UFS_HC_IS_OFFSET;
Status = UfsWaitMemSet (Address, UFS_HC_IS_ULSS, UFS_HC_IS_ULSS, UFS_TIMEOUT);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
DEBUG ((DEBUG_ERROR, "[%a] UfsWaitMemSet failed with Status=%r\n", __func__, Status));
continue;
}
} else {
DEBUG ((DEBUG_INFO, "UfsblockioPei: found a attached UFS device\n"));
Expand Down
9 changes: 6 additions & 3 deletions MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,18 +1957,21 @@ UfsDeviceDetection (
LinkStartupCommand.Arg3 = 0;
Status = UfsExecUicCommands (Private, &LinkStartupCommand);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
DEBUG ((DEBUG_ERROR, "[%a] UfsExecUicCommands failed with Status=%r\n", __func__, Status));
continue;
}

Status = UfsMmioRead32 (Private, UFS_HC_STATUS_OFFSET, &Data);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
DEBUG ((DEBUG_ERROR, "[%a] UfsMmioRead32 failed with Status=%r\n", __func__, Status));
continue;
}

if ((Data & UFS_HC_HCS_DP) == 0) {
Status = UfsWaitMemSet (Private, UFS_HC_IS_OFFSET, UFS_HC_IS_ULSS, UFS_HC_IS_ULSS, UFS_TIMEOUT);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
DEBUG ((DEBUG_ERROR, "[%a] UfsWaitMemSet failed with Status=%r\n", __func__, Status));
continue;
}
} else {
return EFI_SUCCESS;
Expand Down