From patchwork Wed Jan 25 22:18:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13116338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1864CC27C76 for ; Wed, 25 Jan 2023 22:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=s0j82Cemp5wmtCKwqkQ4P/9podvg7ZqV2AX8Q+q9xGA=; b=TJrqPkriZke+K+4jedl7oM6SWD 2L1rnBJ0r88G6Eidzc0nMtJSN76r9afJhSQxTyt5KepfD1q3lUXIb4TkgeH+eBGsbLqs8KFAhNX8O 3sd5oKW1haH1Jmj/EeCEL9rwhX7URr4VXRYCV47IsUkwn2etsfpzOQgmRb2WMmJeKBvE/5VCpyHsP pBTBvDZvFmRnufecTzIl4kRq42W4nxLJ/dxiZJ2l5X1DYPvIgVhexN3971LQLfYViyWFTjE9ukal9 UzQu85liuhiMDuLhrHsCz76INButAjEqVnNJx/AZoNexMRT5xYw3acVJyGtZTNOpkDOqfmwT5u+qn 2aLacHDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKo6s-008yEx-63; Wed, 25 Jan 2023 22:19:14 +0000 Received: from xtrwsqbh.outbound-mail.sendgrid.net ([167.89.100.176]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKo6D-008xxs-Jx for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 22:18:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=sHEGuDI+QAsBRHQDABhGANagI0i+/Ox7a/1vEXYK3PY=; b=oY4iPqE0yBl/0nVlsDUz8K3Qencz96m5NjSKWs3AakkW53Yafd8qDpk2aqNePoJm3nWo VseGSBWv4EsVWBCFZD3YsPpdJ0K/DRn85ZHLyGqRgY5TigASzJbXisqcxUXVMGYk1WY3cU bkB7uZ8etxEtAyl+k/x1gbYzId9qwj/0NCucjTITqswWlQkFvSNU8i7xm5gL6EdfY6Q/3c vIDYwwyODTl7y+0dXkP4yYhJWn6mgITdo4p4qf+EXAYDVd5FLQYi3f+wU6ObnM1V/gVS08 F3UuM8jsjeuzhO6vXHlN17eH7cLbpXvcyBEFTPPw1tcMfZ6I190XX8fJpr3H0oaw== Received: by filterdrecv-8569859b9-xfh5v with SMTP id filterdrecv-8569859b9-xfh5v-1-63D1AAB7-2A 2023-01-25 22:18:31.954514689 +0000 UTC m=+5958699.083386124 Received: from bionic.localdomain (unknown) by geopod-ismtpd-5-2 (SG) with ESMTP id NI2nFHi_TkuaGBqMj9k9gA Wed, 25 Jan 2023 22:18:20.957 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 3/3] iommu: rockchip: Allocate tables from all available memory Date: Wed, 25 Jan 2023 22:18:32 +0000 (UTC) Message-Id: <20230125221809.3275481-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230125221809.3275481-1-jonas@kwiboo.se> References: <20230125221809.3275481-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h/X+CIU4kFU9zG1GiwEbP/5kLr6ZQf9m6wDe9ilvpgqcQh5sPBuMV6GUW1ay67FN9Xi4rS28UZ8dNzfF4/iuyI2P1Nc5Eu+gKjKAQoQ/6+l4KXDUBpw1H3rKCyVVLLN9YqXVpRC6r5FeDlBoY/Tcada9OqSs74s6uIWypT8Ckhy1Hw/FrfZYDZROGOv7R5WM5g== To: Joerg Roedel , Will Deacon , Heiko Stuebner Cc: Robin Murphy , Benjamin Gaignard , iommu@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230125_141833_766930_B9F20E32 X-CRM114-Status: GOOD ( 12.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Newer Rockchip SoCs, RK356x and RK3588, support more then 4GB of memory. However, the RK IOMMU driver is using the GFP_DMA32 flag to limit allocation of the discovery and page tables into memory below 4GB. Let's remove this limitation now that the discovery table address is correctly configured for addresses above 4GB. Signed-off-by: Jonas Karlman --- drivers/iommu/rockchip-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index ca47f198455e..799ecc2c0d0e 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -726,7 +726,7 @@ static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain, if (rk_dte_is_pt_valid(dte)) goto done; - page_table = (u32 *)get_zeroed_page(GFP_ATOMIC | GFP_DMA32); + page_table = (u32 *)get_zeroed_page(GFP_ATOMIC); if (!page_table) return ERR_PTR(-ENOMEM); @@ -1047,7 +1047,7 @@ static struct iommu_domain *rk_iommu_domain_alloc(unsigned type) * Each level1 (dt) and level2 (pt) table has 1024 4-byte entries. * Allocate one 4 KiB page for each table. */ - rk_domain->dt = (u32 *)get_zeroed_page(GFP_KERNEL | GFP_DMA32); + rk_domain->dt = (u32 *)get_zeroed_page(GFP_KERNEL); if (!rk_domain->dt) goto err_free_domain;