From patchwork Fri Jan 6 06:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 90116 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9321505qgi; Thu, 5 Jan 2017 22:52:42 -0800 (PST) X-Received: by 10.99.1.132 with SMTP id 126mr139042355pgb.129.1483685562862; Thu, 05 Jan 2017 22:52:42 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id e4si78543465plb.274.2017.01.05.22.52.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 22:52:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7C51D819EF; Thu, 5 Jan 2017 22:52:42 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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 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: [edk2] [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: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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; }