From patchwork Tue Nov 28 20:49:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13471788 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 3F8E7C46CA0 for ; Tue, 28 Nov 2023 20:49:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B166B0357; Tue, 28 Nov 2023 15:49:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DFAB76B0358; Tue, 28 Nov 2023 15:49:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C25D16B0359; Tue, 28 Nov 2023 15:49:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AE01C6B0357 for ; Tue, 28 Nov 2023 15:49:49 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 89B0412039F for ; Tue, 28 Nov 2023 20:49:49 +0000 (UTC) X-FDA: 81508554498.30.18A98FF Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) by imf16.hostedemail.com (Postfix) with ESMTP id CBA0C180020 for ; Tue, 28 Nov 2023 20:49:47 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=eNpTfjfv; dmarc=none; spf=pass (imf16.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.128.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701204587; a=rsa-sha256; cv=none; b=ojUbjC20UrHRNUOnDLVHpZmN/+CKytJI3RNABRipg/bHOvhkTnZpUWYT/GBYv/SNAPLxKC 9iZefyPlVwehwa7fIq5HVNMxyNE3ZKwO7e/uHNBvaBbq3nmy+DA5t+L1Xx4fSDDYiF6DAc fkBYsv4PBx7bnm6a3ZXQ5mf78sUr8ag= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=eNpTfjfv; dmarc=none; spf=pass (imf16.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.128.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701204587; 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=9pzjq4U1m3Jk3/Q2EGDhq/3TlS/Ht1C4D8j4bsFObkQ=; b=t3aXKEXeSuB0PTO07X+ZyaWnEVXj21PkyB3xHgukj3dVVXm/0oTw38z+Vw5Gq+GMfXTr9b LXyYegdTiR1FEVhelVrVW7d+pA29xydzNemcXvkMtf47eyO2XKqkVlGjunsfpYI6TtnOwJ dxfBFiA8+8j3he0oHaW9t4jwpfHZc8M= Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-5d0572434afso24577617b3.1 for ; Tue, 28 Nov 2023 12:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701204587; x=1701809387; 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=9pzjq4U1m3Jk3/Q2EGDhq/3TlS/Ht1C4D8j4bsFObkQ=; b=eNpTfjfvA5gE8cLv/cGszv6lhSar8KGzrWychBCxh1jLWHPQRbgn27am9KM/cQIsFo 1SlYh4+T1PGvrO+wgGNAstkw4jrgfmDLtzmYN+U2J1OewhcYd0pRq251F0mFK0RaGwPb JsJg9piSWCdKYl4HrI97NzGHAzM3OGEi58Yb7XfRf3A0TGa27lgwjDBVymVW/dm60ZPw CvEUwFgEyoBXuUzuWXQhXicwlZBMXjdhXA0c/x/35lUxkxSkdIF/7VwM2dTx8GY0AV4G 6fZ80hT4LCMQx6ZptLwn6LHWj1he592LHQHX7tEWVEX98vPsWWYRs70p9UVOeSyFBE1L WFsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701204587; x=1701809387; 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=9pzjq4U1m3Jk3/Q2EGDhq/3TlS/Ht1C4D8j4bsFObkQ=; b=CZ4aXePyCkRV8otUPNEHkH/9ydF1t896e/8dUJhEejvM0Mxla5qs0YB29H8+utoh7s 1QcBJvMziT3yfwFm6Tu+lYGzyBaC7AO1/IsikjqnVFGEsSTOGxa2ZBUA1Bwi/GyoCRu4 jd4HmMd1gR/8/t3kYeHUSPzAs+uEJZqoGZhpCgODzaCrWGdwOLnIOIPK+tCrxfW8HvKK rFVJcO17F16jZHft/pCVgVsJDsOFJx7YdrQNMOMl2sKkZTVp7wCD2cd99JMt1yt2xKEw IyV5sI4wQEWJ4qj/v8bz3P7gn45Xiej10/n+77cCsM33dMCoUJ5jtR1jdXT5ilR0K4/H Igbw== X-Gm-Message-State: AOJu0Yw3dL1mLhrGhaGap+Q/1sJljlfmxtIHAmv9xfb2fE1gv/jeYJQB 6vzVjzGOFCaIT/nsIggthH3mBQ== X-Google-Smtp-Source: AGHT+IE/Byn/8N8Vta6BS83r49MMC2Wgiev3AoCZv/F2NdDhJZ9+kkS7XfcNeLYX07tpu8Z2obgTjA== X-Received: by 2002:a81:87c2:0:b0:5c0:fc45:a249 with SMTP id x185-20020a8187c2000000b005c0fc45a249mr12000775ywf.40.1701204586847; Tue, 28 Nov 2023 12:49:46 -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 d11-20020a0cfe8b000000b0067a56b6adfesm1056863qvs.71.2023.11.28.12.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:49:46 -0800 (PST) From: Pasha Tatashin To: akpm@linux-foundation.org, alex.williamson@redhat.com, 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, jasowang@redhat.com, jernej.skrabec@gmail.com, jgg@ziepe.ca, jonathanh@nvidia.com, joro@8bytes.org, kevin.tian@intel.com, krzysztof.kozlowski@linaro.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.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, mst@redhat.com, m.szyprowski@samsung.com, netdev@vger.kernel.org, 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, virtualization@lists.linux.dev, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com Subject: [PATCH 06/16] iommu/dma: use page allocation function provided by iommu-pages.h Date: Tue, 28 Nov 2023 20:49:28 +0000 Message-ID: <20231128204938.1453583-7-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231128204938.1453583-1-pasha.tatashin@soleen.com> References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CBA0C180020 X-Stat-Signature: yn9bdjwb1163db6xq9fw39y1wzqny3kd X-HE-Tag: 1701204587-468907 X-HE-Meta: U2FsdGVkX1/qgOpZtpIpjVlFUdun0hcNy+xdzAsd4HTMGtcr90HM/z5L0v08NafSTWs8qyZRX1uUH9N70jygy18zz2pCD2toeNo0O2uWQU1uiseAgNL1jmXl12bwU0LQto3vgxeoyasG+BR8yXx24CMENCgorjbFzCSXXRPAqKFFLIqkQsmc5MRQgMKxj2u0moGsw8wnO/Hil7zHPUDzN8xjMQ7tUs7549UB4VsQt9H9J0/H0KGUUOKcPya5sEzjgD/vI54TOpGeaboRy7q5T3T5xJ0O2jYSmPjM5WKpJZuvj3uc7DINQDLkiqrHVHndtetOi3sOVzYrK821oQHKvEiA945oo3mGN3JLLwNndg6mWShqX7KV+3HgVfKcmmVEi7hp8BHkIeDT0KGzbL+Zyl1m8FYxALzPbNXTZoDpIYNU82qCgdGFt93aG1ejM4kQEvUklsQ7wyhXEMNzxPPS9pcoiDJTQ4F1SoObQPJPlUpVtGvIs66Iio4dELIsFxTA9Wvj9Trztzrep5Ypcwd3DA9iBEnUvpvqkz8Z8h7FYpdt5wLHJ8NrdWm7wfuEpGwfrjywAdygQnbf1LLm8uHm5SAalCgDWntA/DVjsKmRtX1RTl3dnN7AtHjdnM1Cg52IYaGiB6pX4P5j8CrkmAM5UTj+hZQ3lKErxaqfPTrLlMH5yhFAsgdjcu6TvXbOQW1HJpHgK2rhVBsQg/r5oYtxMTOjLCZlcsbHAc5/don96wZeVZWJmKrb1R+gd9xhXc+L78ns2TDBIpGqD5Afqa887cik7eAd/Lhcotyh8OiMNHIdUaam/JXzIkUfn7fpZNCg9M2hZXZBHyBBMYOgfIldUu2tHUR52yVFmQ+GUIxSJNEKQbzxAn2Ul6acuNQnBa0ZYU+mnhldh44U4mCY37wIsu+HUQwpLkhQc0i0zvyg0Na0L03voi1usN+3/empsvSk8apfAMUtpxsVtL3Nphu zUEANyby CbYggpYpxuxRqruvDyT4z0JvpHkcPY0CLofuYCEjijgdLdIdOodhcHmct9MQKpMp+X24GYGQLnY3OGCGP0QNjVzd1baWx6QPigot31jIMAabShXqOA0q6x2DxNe9wljmGovbQMevMh0ioxyjICp8qFW7Dtq9NX1CS5+xXvUPpkbfyyxgP94xZI17XWCQxQueG3trflC+yaVVmYmE9rTIy675Z8m641OZvygwKWZvjwA35rEH2csuETyeKWRD1/DnIP1T3xuR5D5xAa5fOTZvAfA+iaeaEv7iwPZLQUezxr58Ix+tSWcxhyyxgBDjSff6QuYHgC0o06HlF1KG2FhAIYvdT1RE7MVbskev3nmeaYBcLmkcb8+rvOx35NrmwR8MqAIKCZw09kKZDuO+Z7hiQPOhjmKPN5Nh6zs7PPLcFTZPJ9ypLOFkgX9rt77wsbxEkwLmr 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/dma-iommu.c to use the new page allocation functions provided in iommu-pages.h. Signed-off-by: Pasha Tatashin --- drivers/iommu/dma-iommu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 85163a83df2f..822adad464c2 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -31,6 +31,7 @@ #include #include "dma-iommu.h" +#include "iommu-pages.h" struct iommu_dma_msi_page { struct list_head list; @@ -874,7 +875,7 @@ static dma_addr_t __iommu_dma_map(struct device *dev, phys_addr_t phys, static void __iommu_dma_free_pages(struct page **pages, int count) { while (count--) - __free_page(pages[count]); + __iommu_free_page(pages[count]); kvfree(pages); } @@ -912,7 +913,8 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev, order_size = 1U << order; if (order_mask > order_size) alloc_flags |= __GFP_NORETRY; - page = alloc_pages_node(nid, alloc_flags, order); + page = __iommu_alloc_pages_node(nid, alloc_flags, + order); if (!page) continue; if (order) @@ -1572,7 +1574,7 @@ static void *iommu_dma_alloc_pages(struct device *dev, size_t size, page = dma_alloc_contiguous(dev, alloc_size, gfp); if (!page) - page = alloc_pages_node(node, gfp, get_order(alloc_size)); + page = __iommu_alloc_pages_node(node, gfp, get_order(alloc_size)); if (!page) return NULL;