Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3003878rdb; Tue, 26 Dec 2023 12:15:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9pmQ0VZluzVdpOiHqY8wuxbkrCO9pyKkRNPehCUthZ8nLF35Sduuwjj9+9sJNyM1FD6ao X-Received: by 2002:a17:902:ec90:b0:1d4:5f18:2239 with SMTP id x16-20020a170902ec9000b001d45f182239mr3185923plg.68.1703621734783; Tue, 26 Dec 2023 12:15:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703621734; cv=none; d=google.com; s=arc-20160816; b=jlE0txDvNTnvNxHLgIcOzTAzeVpR/+ZggFbL0u/FBsqFlrILnA3ip/yHuNUXP3MqQ3 LTpW2wxJ9Ud21gD1F+Wmzv+5JJMdg8R+gmkPFZpxAQI4L/y8h4yFPAc4wEOuoXCqGMSI VaXYKROtist6x+I+ccF4bTRl9QF9GmcMgA8UhnfpVUd/SDqtIQ3tLozYlY/mcniFAiFE Ohq31PR6JemkJdns5TW2DZc2AO9XnIWo6K5AZsy7zNpY7uQZCjc0CdxRPEiziRoVD+Wg rlV9MWPqQfeZZ8UeMLOa7xQqzYzOb3xnP702Xjtz/kdKSsedOTSGluECvF8MZGNTcDuU YHGA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11671-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jv20-20020a170903059400b001d3f285561asi9795837plb.29.2023.12.26.12.15.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:15:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11671-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11671-linux.lists.archive=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 C3AC6283B80 for ; Tue, 26 Dec 2023 20:04:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 998911640A; Tue, 26 Dec 2023 20:02:22 +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 Content-Transfer-Encoding: 8bit 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); } -- 2.43.0.472.g3155946c3a-goog