From nobody Wed Dec 25 02:32:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 1509874269614960.978168985225; Sun, 5 Nov 2017 01:31:09 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17DBE2034EE35; Sun, 5 Nov 2017 01:27:08 -0800 (PST) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 873932034EE25 for ; Sun, 5 Nov 2017 01:27:06 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id 4so1713180wrt.0 for ; Sun, 05 Nov 2017 01:31:03 -0800 (PST) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id x65sm4304052wmg.11.2017.11.05.01.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 01:31:00 -0800 (PST) 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=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=N4ro6MRLhZYpnci628/WuKKkJ98WOfOYxIkN8s0Wcto=; b=RDyRgsNRdvvoQ3CxxPRfAIH/oPJGWFsGU/OZN8mqrKYWW1XBGTVNKTGfJM8eklZ6Ma /WgdtZwFgevOGC3nhn5HKSwHSRzRaVYfbd5mpEzT2vtXSI/Yk8/og4rcyaD+Fl08m72B U/5I3/kxK3YEVVqCwj3B7Xiu+puei2J5m8OEk= 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; bh=N4ro6MRLhZYpnci628/WuKKkJ98WOfOYxIkN8s0Wcto=; b=F1WhCXxn8FCeAK4/r+NEWnMdib4ffclBaO64w0TRzf1lLaPK2+Z7eIsmAFyf9cyH7R iwgfpnNDWoJcL3oswk0xCXiMYpKX8DZ8TQss5ORADcIFWNpXU6+tHW3kK4wDuCTkdfgR UJ6eACBqMqZmi0rs9ojZdYY8Fdrg2bTnd4UnG4DRx6zNdSfz0aqXJLRHmuk2y81PS8az CSGp2Bf96SnPrPfD2CxV9UFTH07Mal+RAcxRGpYtEqro9XwvKMNdaaJvkzX1ftmp0oMU hdg4OWWWAS3+4+F1E7gFl7bB6ZwCe9oCPtftN1uJab/B/FUmrwT9fqFUIJtUBlcQceyf AZiA== X-Gm-Message-State: AMCzsaX0t4L12ycRvH7zuJWgWBE7NCKych0LCtCk9ocY7FNtg1PWNF/q H98/I0BC2EzYqfa0pvoOWlFynb2EKDU= X-Google-Smtp-Source: ABhQp+TxHLvtxn9GAy5/N3M7MM56MFLFYCiozaUkFZFGlkNTgvhglxhCCz/+JmKmWDpgPTptzvvuRA== X-Received: by 10.223.130.196 with SMTP id 62mr10872497wrc.60.1509874261948; Sun, 05 Nov 2017 01:31:01 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sun, 5 Nov 2017 09:30:54 +0000 Message-Id: <20171105093054.22349-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v2] MdeModulePkg/SdMmcPciHcDxe: call SdMmcFreeTrb() to complete sync operation 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: feng.tian@intel.com, eric.dong@intel.com, star.zeng@intel.com, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently, we complete a synchronous operation without unmapping the DMA mappings, and free the pages using FreePages () rather than calling EFI_PCI_IO_PROTOCOL::FreeBuffer. This is simply incorrecnt, but it also breaks non-coherent DMA as well as DMA protection and/or memory encryption so let's do it correctly and call SdMmcFreeTrb() instead. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Hao Wu --- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModule= Pkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index 23faec5e2be0..0be8828abfcc 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -1008,13 +1008,7 @@ SdMmcPassThruPassThru ( } =20 Done: - if ((Trb !=3D NULL) && (Trb->AdmaDesc !=3D NULL)) { - FreePages (Trb->AdmaDesc, Trb->AdmaPages); - } - - if (Trb !=3D NULL) { - FreePool (Trb); - } + SdMmcFreeTrb (Trb); =20 return Status; } --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel