From nobody Wed Dec 25 14:21:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15075117550741008.7518026158679; Sun, 8 Oct 2017 18:15:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DCB7E21E1B74E; Sun, 8 Oct 2017 18:12:26 -0700 (PDT) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 8DD0021CF58CC for ; Sun, 8 Oct 2017 18:12:25 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 32F0D1435; Sun, 8 Oct 2017 18:15:51 -0700 (PDT) Received: from usa.arm.com (dbox2.austin.arm.com [10.118.34.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 611353F58C; Sun, 8 Oct 2017 18:15:50 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=daniil.egranov@arm.com; receiver=edk2-devel@lists.01.org From: Daniil Egranov To: edk2-devel@lists.01.org Date: Sun, 8 Oct 2017 20:15:39 -0500 Message-Id: <20171009011539.45115-1-daniil.egranov@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] MdeModulePkg/PciHostBridgeDxe: Fixed PCI DMA Map/Umap bounce buffer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, star.zeng@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch corrects the logic of transferring data between a bounce buffer and a real buffer above 4GB: 1. In the case of mapping a bounce buffer for the write operation, data from a real buffer should be copied into a bounce buffer. 2.In the case of unmapping a bounce buffer for the read operation, data should be copied from a bounce buffer into a real buffer. The patch resolves a Juno board issue with the the grub and SATA drives. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Daniil Egranov --- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c b/MdeM= odulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c index dc06c16dc0..877fa2fd13 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c @@ -1153,12 +1153,12 @@ RootBridgeIoMap ( } =20 // - // If this is a read operation from the Bus Master's point of view, + // If this is a write operation from the Bus Master's point of view, // then copy the contents of the real buffer into the mapped buffer // so the Bus Master can read the contents of the real buffer. // - if (Operation =3D=3D EfiPciOperationBusMasterRead || - Operation =3D=3D EfiPciOperationBusMasterRead64) { + if (Operation =3D=3D EfiPciOperationBusMasterWrite || + Operation =3D=3D EfiPciOperationBusMasterWrite64) { CopyMem ( (VOID *) (UINTN) MapInfo->MappedHostAddress, (VOID *) (UINTN) MapInfo->HostAddress, @@ -1256,12 +1256,12 @@ RootBridgeIoUnmap ( RemoveEntryList (&MapInfo->Link); =20 // - // If this is a write operation from the Bus Master's point of view, + // If this is a read operation from the Bus Master's point of view, // then copy the contents of the mapped buffer into the real buffer // so the processor can read the contents of the real buffer. // - if (MapInfo->Operation =3D=3D EfiPciOperationBusMasterWrite || - MapInfo->Operation =3D=3D EfiPciOperationBusMasterWrite64) { + if (MapInfo->Operation =3D=3D EfiPciOperationBusMasterRead || + MapInfo->Operation =3D=3D EfiPciOperationBusMasterRead64) { CopyMem ( (VOID *) (UINTN) MapInfo->HostAddress, (VOID *) (UINTN) MapInfo->MappedHostAddress, --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel