Should set the length of PRDT, not the number of PRDT.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <[email protected]>
---
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c 
b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index 5c256a9..218e9f5 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -555,7 +555,7 @@ UfsCreateScsiCommandDesc (
   Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32);
   Trd->RuL    = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof 
(UTP_RESPONSE_UPIU)), sizeof (UINT32));
   Trd->RuO    = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof 
(UTP_COMMAND_UPIU)), sizeof (UINT32));
-  Trd->PrdtL  = (UINT16)PrdtNumber;
+  Trd->PrdtL  = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (PrdtNumber * sizeof 
(UTP_TR_PRD)), sizeof (UINT32));
   Trd->PrdtO  = (UINT16)DivU64x32 ((UINT64)(ROUNDUP8 (sizeof 
(UTP_COMMAND_UPIU)) + ROUNDUP8 (sizeof (UTP_RESPONSE_UPIU))), sizeof (UINT32));
   return EFI_SUCCESS;
 }
-- 
2.7.4

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to