From patchwork Tue Dec 26 20:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13505033 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 7B9FFC47074 for ; Tue, 26 Dec 2023 20:02:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF7BB6B0082; Tue, 26 Dec 2023 15:02:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2F876B0083; Tue, 26 Dec 2023 15:02:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 972AC6B0085; Tue, 26 Dec 2023 15:02:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7D88B6B0082 for ; Tue, 26 Dec 2023 15:02:18 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 82D80C05B1 for ; Tue, 26 Dec 2023 20:02:15 +0000 (UTC) X-FDA: 81610041030.11.B8178E0 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by imf18.hostedemail.com (Postfix) with ESMTP id AAB791C0029 for ; Tue, 26 Dec 2023 20:02:13 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=iO9NZZMc; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.170 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=1703620933; 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=nvjQljl7JPoogUlmvytdtR3rbtLgZccu0UZbVKP5s2w=; b=SecOReDAg55WAy42inKIE16JNn3EBqMnGq449F9H5yzRHTXfqeGWhgPSf42smAFyVE7f33 pl0sNDPhtnt1+VoECogodGFCB4ctUAxr44TpEZYLA28rJn3sR4MAWaxL+LE8KBK3r+zhZ2 Bt2Xe2tT9Z4AUtc19mQV/EANSV6/Of8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703620933; a=rsa-sha256; cv=none; b=Ag1wNAhOO1+TFHXmmIzwz0RI/JnkFYkdYhoB5kQkBTAxl5O5llv4iEIDniC+prKGdS0HGA uAO8Y2w98IXYWsOmXiafBJEEcaisZ4dyOh2MZZBUWSFjEiKqFSVVj08UG8WhcDU2OaRgvy udKPmeJVGRL6WmK1wr9/sNFH0flE/fo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=iO9NZZMc; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.170 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7811c02cfecso310822585a.2 for ; Tue, 26 Dec 2023 12:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703620933; x=1704225733; 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=nvjQljl7JPoogUlmvytdtR3rbtLgZccu0UZbVKP5s2w=; b=iO9NZZMc6iSSpG2NKo0I+kDWjfdu4NkKXAnE+Flex20RQqUyE1n7KrfSNB/UiE3Fps BGgeMLoUlEW9vkGWhfWkU28UUtzqc9UmD+AwhuRFuEDFW+O83GYiiufpXGIDEJawXoJY 9ceKxnQl8TFSoDSY0YqPX1WzZuYKDnQM4S8m9Faa7L4laJdwn93Lo2v/WyB1/7Hij/va 9NJspYnS/+gSwOdA15bY6u7pKeEWjekCReYtzvXvRItA5v9rtvnAFmTCi5OHRrUgKexv q0uW9CqjWsdMD3pdN2Jhmb3+/JD7QuOpKRORJ8nlyk8MxpIi6UCCeA+79aRVTWrS6zO+ 1t1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703620933; x=1704225733; 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=nvjQljl7JPoogUlmvytdtR3rbtLgZccu0UZbVKP5s2w=; b=q3C/cpl/AvfWkm9Lol0gqJKESzxTAtuFQz7CPDBAmZsMUL4YCo7Px0nlf7A4Qfhbb+ t3qoLnjHQSABHiKzJxpYubFZ9oG+iXWEP4xa4vWCGwsJP5ESsaKEQAF4FC73O41nqOD7 /V3AAa6v5on9F1mXoW7fxT1RT9vUTMN5jH1iWvd8Ah0K37UOHMkNTYyFdl4503pqeGsO ZT5Q9sMT2ErWlhVpIVoJ/94BFG2pUWIFKtU5To38jp76dQo+4bW353l1n3dz9rN8V/IU FdZ9aXWznfPwAc2zmFoZFOi/38DJwaHgOaDFp8uQubajOr+t/XW4C6ZvxHqmQxYWNh6w FuMg== X-Gm-Message-State: AOJu0YzN3nfgd0uEdRkHQEiNybq95YWWeZs3tIacaBN/jefeKIV4b9Li 2OQFSkGpZ4qhZ5oW/1qcypI1d9QRgkVbag== X-Google-Smtp-Source: AGHT+IHPjp9+2kjPszPXsBaYDpwmHuWWhdFbzpOIFVRda6CdGBRpo12LyU+NRUYukzs17wjh8sdbkg== X-Received: by 2002:a05:6214:2684:b0:67f:5c5:c035 with SMTP id gm4-20020a056214268400b0067f05c5c035mr12074627qvb.9.1703620932853; Tue, 26 Dec 2023 12:02: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 t5-20020a0cf985000000b0067f696f412esm4894539qvn.112.2023.12.26.12.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:02: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, rientjes@google.com Subject: [PATCH v3 05/10] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Tue, 26 Dec 2023 20:02:00 +0000 Message-ID: <20231226200205.562565-6-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231226200205.562565-1-pasha.tatashin@soleen.com> References: <20231226200205.562565-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: AAB791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v3W+ JOs+J2VVNt+jVfB+te1VlLShpvz4eB/wSKRag2AXzI8hH56T+3imBSWc/9CEZOL10uPIftplbWOETt9a4mOgvpwvH+7dns95rwVWETf5cMjKXGXM0GlLyLTcHJKDwftUoK8e0uMcu/EtwGJze1OROnPDeybjpFUnAceoVuX3JMCEkzGEM/JzZEej++xr+Yc+M6LWAVIs//OMRDIJ5cEoXEW9wyG9MovlUs84qFfIGHRlDuY/2uhjMmzgg881coLKyxfDaDtI5pdXM9pZungc/8u/eTEjVtzgXTVVGL0oq0y1Q4A916tSS01nHF2dU3e87tK6OzGAxdViMX9ekNJTKdi9S7fo57lVVqDpxH73Z5M6dW6HkU00a15sz3dHwCvE769HHkFkrP48vbkSqRNmQUGpPIut+3XfeDbDPQi97HgF+XtfGXJZxvdeUO3CaY2NdoO0YUqQTJpVWdpC4eNIys6ixlg== 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); }