Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4135101rdh; Tue, 28 Nov 2023 12:50:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFomx0La4/cwRtAeP9Hy7FEio+4UN0a/JXLXUpL5umuMO1bgkzbfEORARzbtJ3EY+cDivSm X-Received: by 2002:a05:6e02:1a64:b0:35d:dcf:e6c4 with SMTP id w4-20020a056e021a6400b0035d0dcfe6c4mr3921797ilv.9.1701204626834; Tue, 28 Nov 2023 12:50:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701204626; cv=none; d=google.com; s=arc-20160816; b=tPuei3tHWihn04wr0w1vrzk9GqwhaZudOpUfeoi0k1/v32TDCHgS6B/xXoB8HMhjp9 GM9zSw+xV5qIKU3WjPVZrMJF5YxCDDYbiPDvZDwQYhFa8i8uurWta3NMOR0HmM2Dr2Ee EiSwUznTgG6A1KftAP3urwJsszoA496B8QmrIBDnxq596BSVHnw9L4XPVov+pfMxvw5t igTcTc7OCDzhukhCQ+2vjCP+RKkW5B4yuCxDJxYWJoAFS7R997U3ANH7DGDFaPcZJJTO ZxEL81bjJupNdEMAnrOAal8+nbb3bqE2hOc0W/GAYvBD7MM6ydS2o5Qv0kHYdLdLqPSY DU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9pzjq4U1m3Jk3/Q2EGDhq/3TlS/Ht1C4D8j4bsFObkQ=; fh=z7CihAYYs+frw4g3uL4utEDJXxOOJDcFFsLsywo+fzs=; b=d+DpMlkcQLoVzc+YsAXFncuY39VUJSEyX9gMz0GXmwDzmGZGBzDFAIwbMDuESK+pt1 hWcjzqRQmJ0kqAN2pgl+vosN2W01MLC9yruREx+LFpcAWysu3WbiCmZVbibhAHrp6CJd Qzl8qOxq/FV/rXLkz4d3qFEJ4zZpRB4t9+WbhkflQZJHygtDeNanm1S/1xIauIWfXatm Yx4mZJPBXAPfXE8NJDHe2dozzkVw2kl/DArGkJL3ChZQePsWtsMJmsiD1y//0lyvvXNN b5TgMTGOm9aWRBttqr74YF3o2XHQAm+TkEiQoaxWxecCeE/pTTV1SF2UMLNZj1JvSuWS l37g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=eESCoOjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n4-20020a632704000000b005c1e762bc50si12366852pgn.742.2023.11.28.12.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:50:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=eESCoOjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ACE0A80AF3C6; Tue, 28 Nov 2023 12:50:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346404AbjK1UuA (ORCPT + 99 others); Tue, 28 Nov 2023 15:50:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345733AbjK1Utp (ORCPT ); Tue, 28 Nov 2023 15:49:45 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C56801BE3 for ; Tue, 28 Nov 2023 12:49:47 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-5cc7966e731so50209037b3.0 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=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=9pzjq4U1m3Jk3/Q2EGDhq/3TlS/Ht1C4D8j4bsFObkQ=; b=eESCoOjNDxfrFLQ7MyEVad+SgTNdaWIKY9zAC6chNUh+LzlsqIJTp7jW3FM3XiEgaW escNzH8gnKUuAH+N2uVP3GlavOp587ZYyyZc0bGbcs+VSbr/A7LsO2DVA61WUOyPK9rf 8e5E3h8ul2nHgN679Qnhe/KQhFXUJ/g7Jq/fjnVDYU93uEwFt41+ra92QkHgo2UExzkU vgVScuS4d9ZzuwO2f0leQULME174Q/f1n0++ExHntJ8dlgeakTntW2nmigsMfZVGKHlf EuddNsGT/OfXbUZ2M9BtTRAdjAuRKiYZ15Xsfar09fvB0T1tDHNmqU8HIsSc15muKbNY ++wg== 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=ZREHkEhZ0Bd4N3oWcd6LEP1Iwov/sKUjqiYPG5KalFhLWOB70UUhQdlPvrZXr9lFqy DHp4d+XGpaQFi3fqbR+1PGq5l0QSc/n1C2j44llDQeawXhtaKlQMURSGid3SV8LRWBOM lT1geDd9XzT1Z6vVLXbl6lb0+cjBDuvhT4whbFNh2Ig06S4Cn2EFohiDDJZw3u/83jEm sd1zToXDzqoQHF5qgywD+M46tqRpzEUvEL7PQMTiwLq6daUMzeSYH4o6/pa1kUj5b40X shXsY2kjgcuzwwRTgZec55R8qSoqRuGRXMidwQ8KqsaCqYymyfSsoVj1UouYucAm38qM C0PQ== X-Gm-Message-State: AOJu0YysUCdVUvnweb2YgT9eoBfMjJCLAtT7vpoeNtU2TZ/OOa15Fj4d eaAFYzohLqyM0m9wQ5KnY8XBig== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 12:50:21 -0800 (PST) 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; -- 2.43.0.rc2.451.g8631bc7472-goog