From patchwork Thu Nov 30 20:15:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13475019 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 C7465C10DC2 for ; Thu, 30 Nov 2023 20:15:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3F506B049F; Thu, 30 Nov 2023 15:15:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A1E56B04A1; Thu, 30 Nov 2023 15:15:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CC856B04A2; Thu, 30 Nov 2023 15:15:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 689E96B049F for ; Thu, 30 Nov 2023 15:15:17 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 43B9F1402DB for ; Thu, 30 Nov 2023 20:15:17 +0000 (UTC) X-FDA: 81515725074.13.02B0649 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by imf25.hostedemail.com (Postfix) with ESMTP id 58C4CA0019 for ; Thu, 30 Nov 2023 20:15:15 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=QLOyt4Nk; spf=pass (imf25.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.161.45 as permitted sender) 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=1701375315; 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=WwZxW20NTsAI6OtU2mg3WBn7dc7VhXurLb9lJcGaB3s=; b=hbDJCm8Y/lBdMfiU7RuJAVoZvdkuO6ZU15Uxrg7k4AKJsAz+IFQjuwvZMPWsoQ4Rm/Su5g F5f52NZfMOy/+s6iOuTbCY0r5HjJ2SjW9LKMmyiiaEZwQUWom02bgXpZkWZKgsRah6DCjA /xRvVXUmm8HQ7y4ceAlWryoC/RwfWeI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=QLOyt4Nk; spf=pass (imf25.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.161.45 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701375315; a=rsa-sha256; cv=none; b=5ZwKVS4tDj5veZqFcT8UdCcw15gCmGKc0HHyBCqKZM+zBOgkI763iRkzoD2uAcguS9XCh/ qfWYc1w1xqQ+oLfL/BfqJ6argQXSXj8lLBbrX3YBxBgZGyKRbJ5ASbaTvoE17DHCKd0pcs opWAZWaZxcwAXlEIaxbpoDO+VA9JbkA= Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-58d54fd8c5aso694668eaf.2 for ; Thu, 30 Nov 2023 12:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701375314; x=1701980114; 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=WwZxW20NTsAI6OtU2mg3WBn7dc7VhXurLb9lJcGaB3s=; b=QLOyt4NkgSkFtuZC7HcrV+lbAaj7ZNnrwNRc3C0mRIuIEqbRG0NEc43NwVjDntSYoV X5WnQdItlUngp640/mqPwGlePvxsLLjVX8iIlYDQa1F0i/0kykgAitxfi4th9CNFnYrJ 6VmaoLKo65MDqNT5tBByQ7EBky3J1VaXfv+rL5vvSY70/JjATNzLsG3hWik+Hzq8KVS6 mQAOXkqHYTgKaca4RijvzgKh3AhoIA9k2H/B8BGX05BalWB/jb5m/Qrprv9OEDk7geKm 2U3DKUW4oSMwKvNyaQAbEyqF3zWYGp+DGA2QO83Y1AP6hOIW5sFHZrdhURvpMWs2DnCt mCDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701375314; x=1701980114; 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=WwZxW20NTsAI6OtU2mg3WBn7dc7VhXurLb9lJcGaB3s=; b=rhg6TC6WeW1Ww97VL3nPdTlhxubRMyNzoli1Ow7bgUprU4QHT7J4rDwBnO9q9OowpQ E2SC1vnvVhOFhSKP14Hw/RGdFHWcVNTwbZNivyHg+lBbRZ0FDMib13Ox9DfCNCH2EJIU XMkgWaaDlB//4jYd8KhsZZQEeeW2JYCFJsWfbAIezL8m1PWaZH0JXNVm1CFcS+M5BkOX nTT+TXmdjTIZo5hGE63XvU8BiSUrc5havN0yaDuMyzaSql5lTS2e8dwUkOWya0eKYlWS XBxAi5Ob0xtSaiS3X/IbktJ29NXnX5uzvN3abm7kr1fcTyAtwQDQNvgbDrQuoPciW3z9 neWQ== X-Gm-Message-State: AOJu0YxulGu3i/O1eAIM1ePdFsDLCggaeIAE3TnNpGuYn9WM9YmXgiO/ Kq8WNj7KLdsDtBtwW3D2C3+1mw== X-Google-Smtp-Source: AGHT+IGTxsoHsoEZ+jaTqaWghyHDgBjLPZzal0bywx3elLmQBrrmBhd0Hv9BOGHbfQGzeWmE2Kea2A== X-Received: by 2002:a05:6871:3281:b0:1fa:5890:7840 with SMTP id mp1-20020a056871328100b001fa58907840mr16958744oac.35.1701375314449; Thu, 30 Nov 2023 12:15:14 -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 e1-20020a0cb441000000b0067a35608186sm795252qvf.28.2023.11.30.12.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:15:14 -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 Subject: [PATCH v2 07/10] iommu/sun50i: use page allocation function provided by iommu-pages.h Date: Thu, 30 Nov 2023 20:15:01 +0000 Message-ID: <20231130201504.2322355-8-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130201504.2322355-1-pasha.tatashin@soleen.com> References: <20231130201504.2322355-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 58C4CA0019 X-Rspam-User: X-Stat-Signature: xszp5iyyeu4o4e53tb16mkswqqc1rfj7 X-Rspamd-Server: rspam01 X-HE-Tag: 1701375315-150291 X-HE-Meta: U2FsdGVkX19RUiKGBe4Wxh0dJi+ujTJUtbovEYyvjIS8PTPBgnav4C5k3SJrk96r4Z488UaMaPtKo0Qpz7/blmBAugkz62Ovfjj3rcwzCVUJOaSz1e9RM8CHtqxmIbXrixv+aJiijkLot76nSlZnEx2fLivQWSpq1HXdsmeKfXFtsJ/MZ4PuPRNcUhz2kgYH3eD4ZquQzyeznGrg/3gu55ODi4OpK24dS7TFqNKD+IXVXqG71oPwkiek0lNYxp7cRrwckJlf278/WsFJPe+xS46764EX+CuDoJMRgFttZE3atWLn9LPp4Z4c2t53MVryl+VDksgdkz66tBBveXEwVbVSdJt9uU24CYOGuPocJircVynfI1tLSRbkeSo6P065p1ko1dgaRxfl6qHTyBe0XGdyxFGlbDPu+ejtYRnTGWOKk43Lr+jXshWU7ERKgLb9+ixeC9YLWgBq856R1bd4bpX0MGzvoG9VXxR1GEMVXGrMsLiIYj350mWkpakHiP4HEslN8lpiE6gnUeU+KTzIGLIadRLl0wPkhMQf3P5ipWHWC8CalD9xiQNh+MEQUluqVXHKIJYbEGC2P9C7NS/wPPuF4W79Tijp9NRv6i8QyrDzsyR0bsz1vlnX6BEDP7P7Y3ykyJxzUOFqR1ICbCfxsdIt0Hc5sQXR8T3SogpY/63e059rKuxwCS0Jo5mX0tz4HakyLUTrdIKmnzFfwHwSEDPDzXrs3rNZecQFqnH30IcIvchvzfC6TrruJWl2PjL6oSsJzbczB6k1eTKSGFSCjsJKvAR+rWPqHMwykZ8ZKxSAOKlXfMNlxz8OhRGd2glqSr5sAnDC+XZ2hd+W1IGM5El8n7515THEQo/eSWBz1cK8gDNpOFqLKy8vWbfqP8hapP+UvevdHajmwKnBNyG2zRGXk7Qp7i2OY49nYA0rfPlsN8Ipc6MaSd/vH2lU96hMwB3+iLshD383uu99paW 01MZOvw/ laizSYQGWhEQeIdANc+LmGQfwx6AuRGS5kAvfr0rd52FfB7406pk4rb6TfGk6g8w+rROs7evk7CsHgh9Qsp2QcYID34CisNvQpP64ZaldcSeE8GfBTTgzlYTgPfIDkQs0M7Uk0rxccsgd29nL1/iib1N2kp48qY5Bg0rEIjKNnCya6Ev7EVFItqHSCoGssP7Eh1c94RDlTOrfoCjeOHk4s3yydCUs58MCTmSALNlHKTH0CHgBLA3IbgU/gN4tsmnwCtNHjdhqBmH5BATTJzraZUFz84bEAgTjbygTDX9YXqVdsMfWD7dSnHCP49AlMW9cf61fVaE/SptzElTcj+QMExCymNhp3o4mrecJ06BnALPCpmXH72zE8aLMtKQtAlXhgqqiNn0pbzZRrMqamzM5dvxMtgVE2tRlbXAW6/oH9s3+fWJdTyLocQ3QdlUbPAls4goqweXn1Doz4CEh6H1187JbilgIvlMSDfSlYcy3kAPDMpD+q/FgcKp3YVqJtyfBqHpUTpUdH7BplLI= 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/sun50i-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/sun50i-iommu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 41484a5a399b..172ddb717eb5 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -26,6 +26,8 @@ #include #include +#include "iommu-pages.h" + #define IOMMU_RESET_REG 0x010 #define IOMMU_RESET_RELEASE_ALL 0xffffffff #define IOMMU_ENABLE_REG 0x020 @@ -679,8 +681,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev) if (!sun50i_domain) return NULL; - sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, - get_order(DT_SIZE)); + sun50i_domain->dt = iommu_alloc_pages(GFP_KERNEL, get_order(DT_SIZE)); if (!sun50i_domain->dt) goto err_free_domain; @@ -702,7 +703,7 @@ static void sun50i_iommu_domain_free(struct iommu_domain *domain) { struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain); - free_pages((unsigned long)sun50i_domain->dt, get_order(DT_SIZE)); + iommu_free_pages(sun50i_domain->dt, get_order(DT_SIZE)); sun50i_domain->dt = NULL; kfree(sun50i_domain);