From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3CC9B819EE for ; Thu, 5 Jan 2017 22:52:41 -0800 (PST) Received: by mail-pg0-x22b.google.com with SMTP id i5so184308191pgh.2 for ; Thu, 05 Jan 2017 22:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ErUfvZrnBf7j8yQ/BjYplGQyWUpDeiURQnaBXwFJBpw=; b=f9ik25RrCNFGUdOROy1xqSM60l5LIvxjiiR4lS1lxOGH7e6droTbiKU1a6EJKxN0vL 7qjoNqH0tWpZjseX/JYs/viiUo1Sjdjx8XSclOkt2zngKmg9ZX75hZyjUUCQa3Gxj9qw fCqXYvVRvE4RfzxApBfZ/ArTwY3lRiZfAJH20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ErUfvZrnBf7j8yQ/BjYplGQyWUpDeiURQnaBXwFJBpw=; b=F+U8xRWZZKy2DjPUY8760szq9gfvfln3frw2X/m9x8Pubn27nMIS+mQ7MosneULpl1 hBL0ee+ErhD40m/5e9k5PiqR/zhNuFil/IgUCWEoRIVw10kByPdoyfMqqJvj5ucB18ta kk+jGpShrRPYzs8iHDEJnchZTlqI1E0MRSBO9N2X/V+cqnnTMVb0fGv4he2GKC8bKfx2 k2rYrwHLqg5vr2LbdiWE079/Lc4QkkdtP8zRY+/u1jD4Et7pLmHeFO3SQPg7nL/bF2BC b1BuMSu3Xoq2LVT0//P2qejMaIi56BzX3bh0PajV7Eoz94xYBjduXVfxsnO4AJcx2V8h gp5w== X-Gm-Message-State: AIkVDXJTeTCNnVb5Vnkmm0vr2qIFxC2IzqqFfFl0vh1P1dgPNeHQShOp/94ovVZE1aNZ6xn3 X-Received: by 10.84.168.129 with SMTP id f1mr166083718plb.42.1483685561016; Thu, 05 Jan 2017 22:52:41 -0800 (PST) Received: from localhost.localdomain ([45.56.159.83]) by smtp.gmail.com with ESMTPSA id p13sm159096976pgf.47.2017.01.05.22.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 22:52:40 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Cc: Haojian Zhuang Date: Fri, 6 Jan 2017 14:52:14 +0800 Message-Id: <1483685538-11058-6-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> Subject: [PATCH 5/9] Ufs: fix to set PRDT length X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 06:52:41 -0000 Should set the length of PRDT, not the number of PRDT. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- 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