From patchwork Thu Feb 22 17:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13567703 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 7DE8EC48BF8 for ; Thu, 22 Feb 2024 17:40:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A15B6B008A; Thu, 22 Feb 2024 12:39:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 32DF26B0092; Thu, 22 Feb 2024 12:39:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 153C96B008C; Thu, 22 Feb 2024 12:39:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 055FB6B0088 for ; Thu, 22 Feb 2024 12:39:54 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D5509120F12 for ; Thu, 22 Feb 2024 17:39:53 +0000 (UTC) X-FDA: 81820152666.15.BFD1A71 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by imf04.hostedemail.com (Postfix) with ESMTP id 2D2BC40017 for ; Thu, 22 Feb 2024 17:39:52 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=eF+QgYpc; spf=pass (imf04.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.180 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708623592; a=rsa-sha256; cv=none; b=yToRP9ha4ocykYUGLd/y38/H1KAgZ1G0WQZsCDcgp4ozbvvkU/6KLPxCJDK3a6dg/l2z9D fyTbf39Iy4fmm+EoJ4C2szn72LsAxs50WBdim0oLvHYMHwJumka+OJQrI6ufG1nAcoOaSI lh5Jewil9hr4EygIwdTQY368ZtyUwCU= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=eF+QgYpc; spf=pass (imf04.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.180 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708623592; 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=g7w3BmgXmvWecR5SKtsZ1cNA/rDbNvV1OeS7wJNdwTQ=; b=sFxiOyduUEJiVStaoKrhfJWfNRwWruc8AFhUgv9Rso/bcMFwsPlPRYKRKlowgBRnoQhRFU jtcLCH/9q7QPx5czhjnUx30y+1mhKoxHqFsu9P5IpMj0ssrvsSI87WTLmrQjpYF+vBupL5 qzl6he+WQBcpi6cVhgduYQBeLJAMxAw= Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-42c758f075dso10246901cf.0 for ; Thu, 22 Feb 2024 09:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1708623591; x=1709228391; 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=g7w3BmgXmvWecR5SKtsZ1cNA/rDbNvV1OeS7wJNdwTQ=; b=eF+QgYpcKANedrRWyR2TmDqE/uGtHWlgcKI8h4QcbvJhLOQfDEd0Fi+ZPy2Vpd1uUP C/9Ag7gcVL3h0IdIqKf+PujOvJU9mkGj9DyRUV5VDpbJknQCrv30Ti5YFx7af1jTChcO xPb/HttME35hUmSuwSp5qTifNiYh+P+Mp9IfTcx65p84O/IaeYFqGoYgQnWjMroV2u9J o1ymWdh8Dw0KRWyRfHMgyxnUmRK9GW5txKVadwPEIc5bEer0nb7sib7SBN7qZOepHFJB 9wAB16j3QUNNaV8osim/JVz/oP3ifiHtKoK8eI7/oqnga6INkb/bUnYXgU7XMIXS6/vE xqNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708623591; x=1709228391; 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=g7w3BmgXmvWecR5SKtsZ1cNA/rDbNvV1OeS7wJNdwTQ=; b=bkgeUiycIOnAq3XxKBctF97eEjXlD1ta+tTIzjSqfwXFcFYmCDos42YSasXm7c1RyD QT+tl5/JPYRw1/7brw08dix18U58GqEoAv2Kkm5IyWd+EmkBRhcmBpxKrw1bVVW3R2bJ r+ajcL0Wp66kwrvKE8cXOlaEp2y23h6cRrVzcFaRLxlCKrDk6wL6Z70xHwWFYdBBuSTu ycnRotEtlQxaDppbQH45fLtVQw69jALM7WozNOLvdmkbOS6F+mt2vWXT8cyjVbVx0wIY mKOsL7zMnSPMgi23A0CNR4IjRQ5Ba6Cdjq4Jv0uqqsZQX5fcnN/1k8SHIpieXdUlQ72u Ajqw== X-Forwarded-Encrypted: i=1; AJvYcCXQV3NKavpGtyhsaBVbmtWgUAakDjQhwDxrmGhQoik4rcRI9w31X72VKhLtqQ9dWgzQmAl14DPrB4ghWAbXwTDt2PU= X-Gm-Message-State: AOJu0Yy4Uu1FXkLBt3HHfsuYHOQ5tF/+jh2ZJlDuk2Y2Tis5xHZWM3Sv Y7c6++EpbAJs/WZfD4nHzNGHvCRmiwTz+KNuZUgUCUetuf7/mnAvXq8qY/7QfoY= X-Google-Smtp-Source: AGHT+IG90zBa6YLMZGIfCYT7Th/1b5UWVffhOhrq9tGqR1mvmgjPkxAiIwv1iDqI+0/4uYQJoXyfRA== X-Received: by 2002:ac8:4e82:0:b0:42c:8054:8a with SMTP id 2-20020ac84e82000000b0042c8054008amr5212735qtp.27.1708623591384; Thu, 22 Feb 2024 09:39:51 -0800 (PST) Received: from soleen.c.googlers.com.com (249.240.85.34.bc.googleusercontent.com. [34.85.240.249]) by smtp.gmail.com with ESMTPSA id f17-20020ac86ed1000000b0042e5ab6f24fsm259682qtv.7.2024.02.22.09.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:39:51 -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, bagasdotme@gmail.com, mkoutny@suse.com Subject: [PATCH v5 06/11] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Thu, 22 Feb 2024 17:39:32 +0000 Message-ID: <20240222173942.1481394-7-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240222173942.1481394-1-pasha.tatashin@soleen.com> References: <20240222173942.1481394-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2D2BC40017 X-Stat-Signature: wxr9hsxcx14szftf71n8xrr69zxybe3a X-Rspam-User: X-HE-Tag: 1708623592-655265 X-HE-Meta: U2FsdGVkX1/um/YFNBT0ati+SkrI3iw8/o4aLWR5Shx4TIgFLUH0JL9ozagUWlAJMARv9nmHvKl+POvUTGoQ3kQC+EKNZ9R1DXgPXGQq4Wh/MWK0BtLP6rMBS19fpsARJtfiLAdHps+sCF41CBvRSu3MRilynVgVxuT14lu9vxOVMJ+uX9fkvMvBYb+9NCttUOqLURmoPLGzPo9jBJ4Q2O9oYCRFghaoVDB5nVtydtjlyNVpWrWYg9XqCzgI7v38DVY1buM3Unlm86+m0s0d9YBokzg1xAkeunkOGuZ3JYWFpJ3cCZ6iDolDvmpOdVBLZqYHz8pWmxEkkz/NKI3pfqpZjBqK5zLUPmzh43jR/KoN+xHeXRl84DdF67qwHjmh3k8QzYoeurp64N7YEw9GT3DdaY0rlEMORF1ILXrW1BVNSLD8rWJFID4z5ncbvPWLjqCf3aJptETi76z6L0CWLGtL/0/t4t+knIC0my3jYFYrNrzg3bw72Bpq1UnLcsNTeK1IMRD6BWcdLdJaC15X91QfAnOtt0Hjx2Umx9sQWR4X/FhircVoUZhrxLK0ojDxU/Cnmv4BBBR4xDUNexFdDOtKdCSaNavWwDPzqerotpwdFuPPktXTx6mC1Ud74azM9aiPs1X60v82brggduVeo1JPPoNZvtSpSht/rJLAaMNMwSHf8ftOwRsPlDDSUomNVPSsPoOWOCFSLLo2lMJ8nUqiYNu0udQGHICDPIA4xbktGytulwJpdKnKwInXvHiz54+EqtqKg2Ljn+lTp09QHvDJ+d1RWfqOCYX1cZdFgeNKoH+UqLOV7H1TctvTSrDkNxHnVKsZIe9wqNzIKy2RMA6FeK/LoK+MNUbJbEsVj7nxo+Nc0eAfz5i62m97YZnE5N/RGwpFPwv2ultuPpw+4LSxSsp9mGA+J1RcpQ7HQ3oLtqWRbxZDSKBAvEgwvZ7RodJkUb088pakkmCUvhZ 9g7NeQ9b d8KSbB5qUc0FecQWlRdeIZuCsbL5nywPtzGjEDs3Wp62Q5ItN3y8Sw/jSQ4BY75MIMdNj/k+2OwJlazwSDc75qxBMx8FeQ37Dd1rq+51VT8mAKLSTdipgQAL2QVsPWTpORj9ClBGjRwBUIb0Utta2xtKlxhmXdyayIIfnrkAB9hH4ZVkDFk/SSHX2ggnWEKyJvdmxU4GCoEu+llKW/J3sXBv4Dt5dUQ38YvjTl4ZNq0ua/k2QGUUl7Cj6hg== 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 Acked-by: Marek Szyprowski Tested-by: Bagas Sanjaya --- 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); }