public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: devel@edk2.groups.io
Cc: Hao Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Eric Dong <eric.dong@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>
Subject: [PATCH v2 1/2] MdeModulePkg/AhciPei: Limit max transfer blocknum for 48-bit address
Date: Wed, 10 Apr 2019 09:13:12 +0800	[thread overview]
Message-ID: <20190410011313.4268-2-hao.a.wu@intel.com> (raw)
In-Reply-To: <20190410011313.4268-1-hao.a.wu@intel.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1483

Due to the limited resource on the VTd DMA buffer size in the PEI phase,
the driver will limit the maximum transfer block number for 48-bit
addressing.

This commit aims to prevent the potential failure on calls to the IOMMU
'Map' service.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
index a83c213a47..f9174e68b1 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
@@ -48,7 +48,12 @@ UINT8  mAtaTrustCommands[2] = {
 // Look up table (Lba48Bit) for maximum transfer block number
 //
 #define MAX_28BIT_TRANSFER_BLOCK_NUM     0x100
-#define MAX_48BIT_TRANSFER_BLOCK_NUM     0xFFFF
+//
+// Due to limited resource on VTd PEI DMA buffer size, driver limits the
+// maximum transfer block number for 48-bit addressing.
+// Setting to 0x800 here means 1M bytes for device with 512-byte block size.
+//
+#define MAX_48BIT_TRANSFER_BLOCK_NUM     0x800
 
 UINT32 mMaxTransferBlockNumber[2] = {
   MAX_28BIT_TRANSFER_BLOCK_NUM,
-- 
2.12.0.windows.1


  reply	other threads:[~2019-04-10  1:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  1:13 [PATCH v2 0/2] Add PEI BlockIO support for ATA AHCI mode devices Wu, Hao A
2019-04-10  1:13 ` Wu, Hao A [this message]
2019-04-10  1:13 ` [PATCH v2 2/2] MdeModulePkg/AhciPei: Add PEI BlockIO support Wu, Hao A
2019-04-22 20:20 ` [PATCH v2 0/2] Add PEI BlockIO support for ATA AHCI mode devices Ni, Ray
2019-04-23  5:17   ` Wu, Hao A
2019-04-23  6:40     ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190410011313.4268-2-hao.a.wu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox