From patchwork Thu Nov 30 20:14:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13475017 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBB5DC4167B for ; Thu, 30 Nov 2023 20:15:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4F896B049D; Thu, 30 Nov 2023 15:15:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ADEEF6B049E; Thu, 30 Nov 2023 15:15:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92C6C6B049F; Thu, 30 Nov 2023 15:15:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7F4486B049D for ; Thu, 30 Nov 2023 15:15:15 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 52253160325 for ; Thu, 30 Nov 2023 20:15:15 +0000 (UTC) X-FDA: 81515724990.04.BEED5D6 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf26.hostedemail.com (Postfix) with ESMTP id 65D84140008 for ; Thu, 30 Nov 2023 20:15:13 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=E6JM9IPs; spf=pass (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.178 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701375313; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=lTe85jJWNLAzvw2g+shP83evX/xd2kGsvzFrmWOYLBlbpGJOhpRwwBhBNvDOvLmhqpQhTC 1z+Aq02x8si8JEvSdLpu7MROEZob9V60fZs7jgVEfmFWDDbzpsaK8cSdXqJhSmx0+gqew+ ktOECuGyKwvpMWxc25YRGsrnsNA3XMk= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=E6JM9IPs; spf=pass (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.178 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701375313; a=rsa-sha256; cv=none; b=vQEe1oDqWtjooRJiNYJ3kVSmWh8j3uDrq+5OHUNs0XBBAfmkQlhqbOFwYd6jMqoQ4mUIxa dfJWXuYUIaeWUUyrCrtyvASMfB5eucPyIVC4/BUKe5JpAnLbijCLNH+9+Kl0nKt92PG9Vi K52NVfm8Wk7IwMV/k9g87ZhHX9NrNuQ= Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-77db736aae5so66726185a.0 for ; Thu, 30 Nov 2023 12:15:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701375312; x=1701980112; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=E6JM9IPstN6TwnBdlM0j8vBlHeAHXCr2wdgYSBs7NSd9zyNFHu7739msquKhM7GdlL 2Z72J357rlmxJ3IaaV0sde7ldQdrOBQn8SHnY63lBvAF5vkwCQzxPEtLPQz12pCbZz2B PqnulwN2dQeM9/LzgGULGb2si5F2TxKsz4+ZVAi9lKWRli+PMGenaZyHtHCPWKt0MDQo GRAc/8ZKmOvHh6YxP6ZawPADlL5mhV8tBpu/RggPxh2wcSxku9EQYdkJw1aUkb7r10Hl oJ5b6px4UZRmNUSTHAzRF1phex8YWh9LLotFqe6RcvwtB3MeTZGtK8prsguQQO/JpwSu VWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701375312; x=1701980112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=dgW9BQRveXvGtMbC9CjcflicyHFOCpqoc/KnqDqWHlPYw9q0HtDrlPTdNnrxJ80faf QwWNiTN/ddkRP18JnH3ymF0DlquaNz3fICXlHOUFVcqK1LVogpgRQPkmu6K4XeFKInw6 5vyKTiA+OKOMgUV+0RTg4tGwBh9MOC8OGC092xolZAnmy1DEVqn0IZ74yLo7VJ5uJiXm JIdMqAQS/8nR5HzJo5nGQKT9A0lfAgwqDCkO3NJskeT5qa8XucuO8pOJzSrB/rZaFB9b m7fi2TgB3KRI6e5Twodp+gAh/Cq4oxUzBsSDkyIJ7w531dos4Gc5DkL/cX5/HLZXoh7T rJbA== X-Gm-Message-State: AOJu0YxwDQex8sPu70ZZ7XRMmLLO1AYRpgn4dOnch/nZKySx8n+0jpwU o96lgpMKcE91yaCN1rrp4DPOsA== X-Google-Smtp-Source: AGHT+IGcwSJfMg7Wvu1IirdGyJp85Q7AXnz+gps4Wsq6RDzrMQCHyomSRCyLZSC9k8WgNjE2V5K0wQ== X-Received: by 2002:a05:6214:2e11:b0:67a:93fa:b331 with SMTP id mx17-20020a0562142e1100b0067a93fab331mr288846qvb.6.1701375312521; Thu, 30 Nov 2023 12:15:12 -0800 (PST) Received: from soleen.c.googlers.com.com (55.87.194.35.bc.googleusercontent.com. [35.194.87.55]) by smtp.gmail.com with ESMTPSA id e1-20020a0cb441000000b0067a35608186sm795252qvf.28.2023.11.30.12.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:15:12 -0800 (PST) From: Pasha Tatashin To: akpm@linux-foundation.org, alim.akhtar@samsung.com, alyssa@rosenzweig.io, asahi@lists.linux.dev, baolu.lu@linux.intel.com, bhelgaas@google.com, cgroups@vger.kernel.org, corbet@lwn.net, david@redhat.com, dwmw2@infradead.org, hannes@cmpxchg.org, heiko@sntech.de, iommu@lists.linux.dev, jernej.skrabec@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, krzysztof.kozlowski@linaro.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, lizefan.x@bytedance.com, marcan@marcan.st, mhiramat@kernel.org, m.szyprowski@samsung.com, pasha.tatashin@soleen.com, paulmck@kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com Subject: [PATCH v2 05/10] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Thu, 30 Nov 2023 20:14:59 +0000 Message-ID: <20231130201504.2322355-6-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130201504.2322355-1-pasha.tatashin@soleen.com> References: <20231130201504.2322355-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 65D84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QGJdCJ rbofYw+Y XrV4olpQAtTop9N9M9w4Cb20bJFI2Qh8wrREDVtNDeOM0P2r0W2Qedc8B6zQLLXTxDkWw1j7UyMmuLOsOpfI88Hr9kyBaueYTCYnBWf3oxbZOpA8U0HddB4MbtwEh18edToTVlrsWxi4yIDMKe76yVygD2DB1ezTuwVt2aTMHA7cFl22fLjw6RlR1C1M2+T7+/RKKD4aaMFCUT7H6fSO+U3YNIct3XSasM6eSblSfKheTD9PuKPaI5/TYPjCurCa+t3wi/VTEjsXiirUsKMdf6Ai3V9bIy/FT0l4mTkepMHa70UvB8HMtgqjUq9oNUHODsMxQFdvA9FuiQQrxRmuh5fIlfMWz5+IL59OMZtEpdDcetZNcbZgiJxSh+uF8Tfc+LFyOiLJcy5RRYqntXmzW/946Q54hCL1X3quP4kVUG/qFneX12IT/Jyo34ZQQ012e8JHNK7miT1Uu7/A1CWPqzvMNI5C0eHvqJdtulir9INSpDJusPHe980WdvUJvF9Gn+addp8u3mtg/G8+YhMoWtcABhA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Convert iommu/exynos-iommu.c to use the new page allocation functions provided in iommu-pages.h. Signed-off-by: Pasha Tatashin Acked-by: David Rientjes --- drivers/iommu/exynos-iommu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 2c6e9094f1e9..3eab0ae65a4f 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -22,6 +22,8 @@ #include #include +#include "iommu-pages.h" + typedef u32 sysmmu_iova_t; typedef u32 sysmmu_pte_t; static struct iommu_domain exynos_identity_domain; @@ -900,11 +902,11 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) if (!domain) return NULL; - domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2); + domain->pgtable = iommu_alloc_pages(GFP_KERNEL, 2); if (!domain->pgtable) goto err_pgtable; - domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1); + domain->lv2entcnt = iommu_alloc_pages(GFP_KERNEL, 1); if (!domain->lv2entcnt) goto err_counter; @@ -930,9 +932,9 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) return &domain->domain; err_lv2ent: - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->lv2entcnt, 1); err_counter: - free_pages((unsigned long)domain->pgtable, 2); + iommu_free_pages(domain->pgtable, 2); err_pgtable: kfree(domain); return NULL; @@ -973,8 +975,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain) phys_to_virt(base)); } - free_pages((unsigned long)domain->pgtable, 2); - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->pgtable, 2); + iommu_free_pages(domain->lv2entcnt, 1); kfree(domain); }