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: 183376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1077531dyb; Tue, 26 Dec 2023 12:15:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmaR/wmH1yGArFNmfhfTW+kCpm83AAxtEhnpn0mOkbRlcT017DKTZhK4Cw79denqQYxnDq X-Received: by 2002:a17:903:2447:b0:1d4:42ca:a1f4 with SMTP id l7-20020a170903244700b001d442caa1f4mr6014720pls.114.1703621727250; Tue, 26 Dec 2023 12:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703621727; cv=none; d=google.com; s=arc-20160816; b=AbOzz+XBtDIXZdk3SnmWbPRz5fwK3bjQKNfL0I/ZETdFVbKAtrPFOv2w+6tiwlLGEJ hlsFUNMXnoy564s+F5rDJCF0JkaPdbTtmzYNkmfbvo347RVb3ayDM3BvXv0Trdb6xxEx pQbKEfDLt1mCLHHVCeDScZp/Z/AHt3vhTDr5o361wRDaVMprga3+ppWNq04HkaqKd9a4 WSgtftlkhun3zjgknKFWeb+JaEFH3ET/xNpn99PLsUpJTFpFXvU5infinCMktGBpXqOG 2gaRnN/Y5IVo3PZR3QgDi/A1PpDjqOYfcinxTMLl1nThgDQxBbBwEx4TD4nfO1yVHCZZ dLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=nvjQljl7JPoogUlmvytdtR3rbtLgZccu0UZbVKP5s2w=; fh=lUkiT048LCyG2kYH3uS9GPNyu6fkGQdYtFXGdyQ4NZk=; b=YGoJE4X0Pty57vXLjv4WMLaIXjouvAU+0lLpQqnEe9Eb10lxd+vRma40NdBGtLtS4U XfL35Mv5RNW6mN+YHYSMgn8celf/LBFDBdtIitnVSCYJyqnFP9wXPGAptooOTmBHDA+W klWvsqqf0vtoxId8eu374kvSpbaAt+MuB1FJ70WAEnqbgbA/jM3d6egCjS7YtwmHGfKM Zk3JwdEqODbRfZYJnWRgBeqotzZIpU7XNEh1qi4hu8jWxcssAZ9fi4u5ZnVI/jHVRIa7 qdmYxfxT4W/obwjq2+PFUwuWrwF8HaTJnkrQi0gpRrn9soMSO1eb+8sBfn6uCcO9t0dz mYmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=gtJVPZ9A; spf=pass (google.com: domain of linux-kernel+bounces-11671-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11671-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y10-20020a170902864a00b001d0ced77a90si9691611plt.510.2023.12.26.12.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:15:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11671-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=gtJVPZ9A; spf=pass (google.com: domain of linux-kernel+bounces-11671-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11671-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 078A42842A3 for ; Tue, 26 Dec 2023 20:06:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B7C18E17; Tue, 26 Dec 2023 20:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="gtJVPZ9A" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83974F504 for ; Tue, 26 Dec 2023 20:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-78132affa95so226097185a.1 for ; Tue, 26 Dec 2023 12:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703620933; x=1704225733; darn=vger.kernel.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=gtJVPZ9AG/wS3K12IVMJ3ccVJGcRXRUzF/PQBKMm9Z6oO93Ewh92WLp5PFCzVFAWVO O63zwyCJbN7gHzsffiQPcgtuEw0BZDZuJ6NLWp9VsKMbX7iaHpuvKtdq0ImV9XfWlPQ3 mY+Op1olDfRx9IAalnbT+wCncYsWOiEylppiv1DgQTExCRlL5jbDiYKoQ+SVrcwSW38I 7NaTxCWldhRtJKn6SmdcCDCiUeCpHyiR5qI8ObEtsZb41LAU6rEBZkOIIVeB15jeWo2h CLjPz6cIrczP17MwRZbv7MsL2dbYOmEwHNypmnw9xdNvxc3w4z4KS9Re68uY5grkaKsq 8olQ== 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=RkJY8SB+PPMndSZ0NeTPWV+6Rv3fhKcR/SHGSYF43lku6ypSg2brf03TG4ceivv22J aQVy31yN8JcLGp3gzqoqLr/98rjIedeJQSwnpyyOd6zKxGp9HBmY4SI+RjuzvtpoKUmy zSOmT4ktsHzD2A1W9dy12zGWi2YBYLk3ouDgnwIQRy/s0E7e/NvWEvLLbchs2tBglpGG 36Vx+TQXGQU+PIZatnJqYkgzLCfB8aIKhygYi0LVu3Ph0+07mFSowJtRVLATP3HjPv2m 4rfJ6b1Mmd7L3NzBalR5RaVIKVCXBE5xPoKxiKbo7RnzBykEKMdUBKwZkBoA8NTiuYy+ I4FA== X-Gm-Message-State: AOJu0Yw7sBWLZCxVlyieIP16qQGbqF8GHKWw1WtXzr9DNeuigiB92HDn JGcdzxSB63kj0V+tZ4YF9XP4Cc2sFe3AHg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786376856424373452 X-GMAIL-MSGID: 1786376856424373452 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); }