public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Hao Wu <hao.a.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: "Cohen, Eugene" <eugene@hp.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Ashish Singhal <ashishsingha@nvidia.com>,
	Hao Wu <hao.a.wu@intel.com>
Subject: [PATCH v2 1/1] MdeModulePkg/SdMmcPciHcDxe: Fix DMA on SDHC v3 64-bit systems
Date: Tue,  5 Mar 2019 09:13:41 +0800	[thread overview]
Message-ID: <20190305011341.10440-2-hao.a.wu@intel.com> (raw)
In-Reply-To: <20190305011341.10440-1-hao.a.wu@intel.com>

From: "Cohen, Eugene" <eugene@hp.com>

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

The SdMmcPciHcDriverBindingStart function was checking two different
capability bits in determining whether 64-bit DMA modes were supported,
one mode is defined in the SDHC version 3 specification (using 96-bit
descriptors) and another is defined in the SDHC version 4 specification
(using 128-bit descriptors).

Since the currently implementation of 64-bit ADMA2 only supports the SDHC
version 4 implementation, it is incorrect to check the V3 64-bit
capability bit since this will activate V4 ADMA2 on V3 controllers which
then causes buffers to be allocated that cannot be DMAed.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ashish Singhal <ashishsingha@nvidia.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eugene Cohen <eugene@hp.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
index b474f8decd..5bc91c5337 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
@@ -666,8 +666,7 @@ SdMmcPciHcDriverBindingStart (
     // If any of the slots does not support 64b system bus
     // do not enable 64b DMA in the PCI layer.
     //
-    if (Private->Capability[Slot].SysBus64V3 == 0 &&
-        Private->Capability[Slot].SysBus64V4 == 0) {
+    if (Private->Capability[Slot].SysBus64V4 == 0) {
       Support64BitDma = FALSE;
     }
 
-- 
2.12.0.windows.1



  reply	other threads:[~2019-03-05  1:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05  1:13 [PATCH v2 0/1] MdeModulePkg/SdMmcPciHcDxe: Fix DMA on SDHC v3 64-bit systems Hao Wu
2019-03-05  1:13 ` Hao Wu [this message]
2019-03-05  2:18 ` Wu, Hao A
2019-03-05 13:38   ` Ard Biesheuvel
2019-03-05 14:11     ` Ashish Singhal

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=20190305011341.10440-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