From patchwork Wed Feb 7 17:40:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13548805 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 28B13C4828F for ; Wed, 7 Feb 2024 17:41:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FBF86B0080; Wed, 7 Feb 2024 12:41:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AE4D6B0081; Wed, 7 Feb 2024 12:41:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 027EC6B0082; Wed, 7 Feb 2024 12:41:16 -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 E291F6B0080 for ; Wed, 7 Feb 2024 12:41:16 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B243C1C17CC for ; Wed, 7 Feb 2024 17:41:16 +0000 (UTC) X-FDA: 81765724152.06.673ADDA Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by imf12.hostedemail.com (Postfix) with ESMTP id D8F3540007 for ; Wed, 7 Feb 2024 17:41:14 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none ("invalid DKIM record") header.d=soleen.com header.s=google header.b=UJQTMpdA; spf=none (imf12.hostedemail.com: domain of pasha.tatashin@soleen.com has no SPF policy when checking 209.85.222.170) 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=1707327674; 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=HRs2+3L7reOpWDJLX1eglKVbVfztnuhe5Gbs6bYq4mk=; b=2j6zSb1QnWzbQBsCYwoR8NgKG9Ayn0sSIIHmM6vy9jGUYF1mGUt6LBLsnzlYXykGfnTs5D dCKiwYptnEgZBB1XLUoOEGmnbK2h/+x7YqiSlCJdwG/wikmaWr1u3jNTOqQjLd58zlTwQE BKdcnP0l3ryT3eDxWdfZjlHGvkIMUrw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707327674; a=rsa-sha256; cv=none; b=198ErCNBPxy9T0SQJuzY9f5ZKGXbtV0CCKxBZU8uvbEydPieRZQbgf2lFaWmHXvO4sHHuf JsdmJaijsW2Rfth4maJv7UFfmGZOlTtMcY1DUYTy3ebXCuRZwGGwlropQGNo5ROFoNYeDF wKcTzyzIrr3q6+9o7KZa/fgVXbuy79g= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none ("invalid DKIM record") header.d=soleen.com header.s=google header.b=UJQTMpdA; spf=none (imf12.hostedemail.com: domain of pasha.tatashin@soleen.com has no SPF policy when checking 209.85.222.170) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7857bbfb25bso52359185a.3 for ; Wed, 07 Feb 2024 09:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1707327674; x=1707932474; 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=HRs2+3L7reOpWDJLX1eglKVbVfztnuhe5Gbs6bYq4mk=; b=UJQTMpdAXkvR3aJUwro6Ao5kGIBtZSsl6WSV62k8tQpDyDqnUVelbz2/is1ysfnup5 UYSJYe1kc40njx8NZ6tjSrUevHe5+ML/cK02SZiJmtrGfRW7acfO+WqO0dZ0uBM10INu M7iI1vd7KjWulJpCEOi9/YsH9/3dujesIQ1YR8tipsNZCkXePYriDB57ifeO1l5by1pH vjuVakNutczNFKFw6p3KzD776dUoyXqLchnxFxKluYakHvvE1ehyU7PcONvBSSgPqP6Z ozdXoeaUgtUhDta4VL+dvZHrEI053YpheuxEjeDQMVYOKTsLjo0czANLbSPb14IpRMx6 1/yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707327674; x=1707932474; 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=HRs2+3L7reOpWDJLX1eglKVbVfztnuhe5Gbs6bYq4mk=; b=uD+guOQjUhzDxdhYRfQ1g7GuBmYzVbNySnJIBvpRHh49wmvjMhSl8nyOjhLAbTh9PM A6cetb0AUp8Wyr6bi6ueMNWkt5m8sXAZ5+G53pd5OZh47OJ56gw1rs7fNZM38P4caN+d GbmT5MYkVSRaHmJ0tcPxP0NHR/XE6WOue/n31iCk/Rge0FSUwEydqHPbVAOwwyiaB9oV 6ji1wTxgOqkLhPN5TCnIbEilehPO45xe2ehVXy0alhp9nJC0FKYQxuUQUsxnnRwHOFmS 1iJNEMv9EpnMzdRAbJeaccByZX/SgBZ0NgVh70LWk8UIOI8RzSRhcswwyaS9hI0S/ch6 xjOg== X-Gm-Message-State: AOJu0YxGxcXKr4yC4KGPjYmr3+9gBORQmljoV05iI6hgxyrIUjIYaeGu ie6sIvf99xeh+nqz9mRUaOECcL2bWk7STbbmXd7QzjrsaNGrJ1hNtSE3Djb4gbs= X-Google-Smtp-Source: AGHT+IHjEFIw63ES6/svy+aJUbNe0c3qyC0BVt1dJGlizw8NcPZWt7xtHW6wZZRb5sI3CTWzt+qhwQ== X-Received: by 2002:a05:620a:8d5:b0:785:9e66:95d8 with SMTP id z21-20020a05620a08d500b007859e6695d8mr1885336qkz.48.1707327673940; Wed, 07 Feb 2024 09:41:13 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVc5nMONWxYqW32x/6V7C+9nsKXLKoua7ZIdfEJQ9x8/76Jss63+h6JD1mwJGehXsdSfnoSE6+lpv6Sp1vmZpeaIMONknbVszHoRqTt5fTy8P12Vq+8tTBuH7Uy4QgZ6fXnpFyK380IN74Don8Zz0sp/QqAdGZSQPsBKW8sjK0Fst0EbZ95wEEG8YOmR/P2K++j2TCeaX3xfIWpaQbA4nhqcOc0acSAOLM83i2FUlU6UMphppieS3cN7iuYDfW0oEQgrLqh9GLJc0dHqVBbY9sQYR6Fdh+6ZhcEk9HvMUnkTYfVj3uRBfn3nZYgvk8J50svOXjNvbwCqE72I1PhyrfREcu8sv4mo83W7LLp26mCaaRaLhCFbCdBTVM67IPzB/v7k3n558PzJ+iSs9ZY/jx/sRmUzJgfYvnYEuUdriETHQv5iiXvKDxws/t5ycciWe07r26/gYd7DiqDZYqc54wrZakFHgVcdyHngL7pa9VuPchRKaGPU+7w9c2Hzx4I6X1pscVNNtydVeaBUks33NqUx39wSKcNdEfcvSWm2+GTDzrOAxxRWrbr/t2ufdNbl0aDfRNhzbEZyzWLVwNv7fMAHTpJ6omPUzOqVXTEyojAN9ghrOeGm7Dk7xVk3uIqvRy0DSPI8E+Ze+jwOc0pGkL++sx17P19vuN5F/WKF70+28kLiFtKPh9EEQMzE9Y+eGyK7u4jcJcdmhWeLzz9Y9xuQ429YF6B7vdicCw4DsR6QHTJ91JqRu7YmoMKTGscsZGBWVPk5I4iXH+RgowpMH0OHu8dOQT03o3NRZZ3TaDetzJRsZFy1j44IFOIQ3EV6DNJ9EjTCG//WzyV9wD2pFnbL+Of4xb/EpC9P62qIVMoWPBpO6KemXj5aQ+LEwYdUBXma3LPINQtkBPh/qWeSt2PBWoCqF0UZTeCakLLkwC4IkPycERVRKkrcA0R9q dTW+gehB zBIIjQzpGRxu8l7H8HwrUiovJ7fXKfCLuaCVsXH9ExLnfN/ZaGHlIleJ96WFudMmoD1G61fCa/wZ7yyJt7xQwppSTHNqYVRIuB9/1fvOhzh08uUXo5ePZgiP9OkKTN8Zy0LPuIQVUhgt4xH+BK1s6cypKWqf5wIxZBH2qjEPeOKI/sJ7D5CUKDS/PxMSV4xM4AObmMSQ6XDZY5bkJQYcGkAhwZ5RGigbS/5NgMI0Q16vYJRG5+JDv6lRT9ua8vg7jGy1zzv/ZH7GebBVJ15gy/mZW4P58ZyHkrIWYMtjRNiy4LchEOcm3vlX3jSaGGuzqY8X4RGVcrkaRZ+Siz5FY7UZaWnCoG3k4aMUGcm0IU1zwsz3RnrOR1YyhTAihG7LRMINuGCeYroByqcTuKYMaJIdQBiGr8oZuSWloHGpuOLRmJcdPTtxdEXvC1xiyJ+MEbmpS9Rrpw/f92KkqyRaC1mk94U5VPxRjV5upOa72CWOm+ 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 e10-20020a37db0a000000b007854018044bsm696310qki.134.2024.02.07.09.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 09:41: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, bagasdotme@gmail.com, mkoutny@suse.com Subject: [PATCH v4 05/10] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Wed, 7 Feb 2024 17:40:57 +0000 Message-ID: <20240207174102.1486130-6-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog In-Reply-To: <20240207174102.1486130-1-pasha.tatashin@soleen.com> References: <20240207174102.1486130-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Stat-Signature: e4r9oc5krxf5o389wzxps5i6jaoi6un4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D8F3540007 X-Rspam-User: X-HE-Tag: 1707327674-848677 X-HE-Meta: U2FsdGVkX1+HbW+C74z4hxMcSFR3okzNYxQPO0t2k7tyspsYi9xt1LMMeFW0GnxMPUML89fVTg2NzfB/V9DdulrFrGCp2OgKdnCubJPs2H41tsD0kCmRvOj7OzSPYgZ91dz/l0DbroOJ/iz4Lk+nzfIVySh3M/ch9Rpu+LHbolrtB0EBnx/8w4keqcmtnweVrdjnZzdtIMS0M+D9H1z/CFDQjm6KqcMeAOSN+IN2teZfBCeq7Wnok6mqhxNeEqyyc5esnnR4t0KPEp59w/o0kwWH5P0j03emWlHwoVWb8kQ50QTMLzlaC8Had5w12E5xVbPa86XoqhuqhYB8oZb71EYoMc0WOtWtxI9z0xbay9Z0+jMDNassXMqZi/lWxs/Ct1VatUyORQo89nt9OJtQW93S2/pjwquHdMyZ/yocvCLtwZrwaqRiMp8OxfUyvvokxNpzk0BGjQrY55UQ50rNVO2iBZllJI1ZSYWYN2uwDPS1Fi7XPaN4AsrVb7GL4IKHShPrKex8t8X0PoG0SC9cH/bfELPpRxSNv9M9rLLcdo5VhnSn36WbQUjjC9tq6oEv4SJ9u36gcd+9NMsX+qe+uvLL9DnZOqzWrgyPMC4JGD+J3J27VzQzMx798lUZI2BgdEPBrqWPwtGB/nVFhXidzwvK1avl55/fRXU4fn30Uv/rZdip+LYmeS4/gIHqFr4ltccOL5PB5/3XBK2WV8X6SCh0iIH2JeGEuobksS9g5aQT60hbBCqjmO+XF4+UIHm0uye0nNn1G9iNOVWEqlYvsLGsVaBxocSd70p2zhwwALkzqrptcvhZy7vx6bOCy1YpCmUaxGQ/aoOD3kH2DLNYUJ/YOWCGEifB2nXmU9mvhv9TMYH60U/cMBjvVC6gnWiRa7lm+g3b6nZyk1HGlPeYvuCU+jJ/t8+A8bUyWfZI1/J9Q4JyowGHbubJmxqst1D8Lnt/LVZycc0oVC0NkNL QawhDzqX ayLx7F8awamf/kh4b7eBKVL7YhE6Yfpm6J0KJ6Ppvlj+3GxzLwmGr3OTDY43QvE0NEyBjbztKCm0odQcz3o6b1XImyATeFACIeOL4sU4jU12KAzePjRD73zZzNM7mBmJomvYQ87MGGnh1hfYBkJHKrULx8RVlqLbx7UkohqeH97WgX6iG9zkco46ChgFHRLhJBqzIH4Eperq8UI5tFTskr8ac8VQeQCpyaC4OfBzt+wJwCNSv0t3FY/C/9uRPWfPK+ZJVRXQybdM+NSH/S3nZmtoqhIem+3SCEMKDdY0qtAqOXbywyeYzh/Dcw+BuAWQpQpUDbOtqxO4qp0bQ4c56tH41T6ovc/V2Di/qblji7G51k2zL96ILuOUQt/el/BCOlVCGkW7qriu+2SlvU/gL0jsUfumYtbF4x0bu08xuTNLWwaE/V4FslQIaok9yUD+KLgHI 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 Tested-by: Bagas Sanjaya Acked-by: Marek Szyprowski --- 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); }