From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::742; helo=mail-qk1-x742.google.com; envelope-from=vladimir.olovyannikov@broadcom.com; receiver=edk2-devel@lists.01.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (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 66B7621122E52 for ; Thu, 6 Sep 2018 11:55:47 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id z125-v6so8058267qkb.12 for ; Thu, 06 Sep 2018 11:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=rnMjA/o0Gd6vWrb87/bBytlbgAPspbs3U+gAShvTrng=; b=QqlBIkDnD2OI6rM9FFskYitwZCgNw04LL6DE7M7piGoZWwA3/AeMVsSVwkTF1ANsto 3nxYrE1JZi6Y0Bvu+O/UEWNgnOrKPcr5GPF4X7eb2MUBn9GuhtFlhmL/BxTsdAbIBTvI y0fuAJBkJ8w3kt2oRN7c/kXWqVC+Pe/U1ac6w= 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=rnMjA/o0Gd6vWrb87/bBytlbgAPspbs3U+gAShvTrng=; b=HQR38eH+2VGpDqYjN3oPnIkNKQD+F7G9TJOBethud9t3qjp5UvQf0xyMslg8R5unIU ilEQpZ8Sl5xZNp5jTzAvYxCpBFcUpKxBh+kJHpGyxNuWaqvBw3iCnmRID4/cGTHviLFo t22w3wjjlpkpi+nplj8b4bGiZuJ/V9MqJt0kjmehgeV/RrTUqWGc4uLW0wxPoa7UMKtM 1Txjy6+TEgKb5WEojf+lU9HE5WuK0S2nji4hGkxOUjFN09+O5Zju++TZcRjTM2NfAWfn H1xCKXm20poHow52jurQ11d2di/KXWlN7ShoBA03R4nty6i1DAprrwDg8LUedj14B5iW 6aIA== X-Gm-Message-State: APzg51Ap+BHuhfgyYKgsFoe0JjlxpL31P7B3XgLKqV99ccLehfKV/Xm7 JDw7mUvvJPGuLBe2ghTvRudiNRuL+2nVlw== X-Google-Smtp-Source: ANB0VdZyR1nQqs3eCdTwsjnMje1X3IXsCB4tIhHPgyyyTpfi+FE3VljNSE3i/NaWuDQJyW80/SpVog== X-Received: by 2002:ae9:e314:: with SMTP id v20-v6mr3254568qkf.69.1536260145752; Thu, 06 Sep 2018 11:55:45 -0700 (PDT) Received: from LBRMN-LNXUB114.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id 187-v6sm3417010qki.19.2018.09.06.11.55.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Sep 2018 11:55:45 -0700 (PDT) From: Vladimir Olovyannikov To: edk2-devel@lists.01.org, Ard Biesheuvel , Leif Lindholm , Ruiyu Ni Cc: Vladimir Olovyannikov Date: Thu, 6 Sep 2018 11:55:02 -0700 Message-Id: X-Mailer: git-send-email 2.18.0 Subject: [PATCH 1/3] EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBuffer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2018 18:55:47 -0000 The only valid memory types for DmaAlignedBuffer should be EfiBootServicesData and EfiRuntimeServicesData. However due to the typo, there is no way to allocate runtime pages, and INVALID_PARAMETER is always returned. Fix the typo. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vladimir Olovyannikov --- EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c index 564db83c901c..8ca9e6aa5b1b 100644 --- a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c +++ b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c @@ -154,7 +154,7 @@ DmaAllocateAlignedBuffer ( // if (MemoryType == EfiBootServicesData) { *HostAddress = AllocateAlignedPages (Pages, Alignment); - } else if (MemoryType != EfiRuntimeServicesData) { + } else if (MemoryType == EfiRuntimeServicesData) { *HostAddress = AllocateAlignedRuntimePages (Pages, Alignment); } else { return EFI_INVALID_PARAMETER; -- 2.18.0