From patchwork Thu Feb 22 17:39:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13567706 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 B15F1C5479F for ; Thu, 22 Feb 2024 17:40:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A3F46B0092; Thu, 22 Feb 2024 12:39:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30BBF6B0096; Thu, 22 Feb 2024 12:39:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DEAC6B0092; Thu, 22 Feb 2024 12:39:57 -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 E3C216B0092 for ; Thu, 22 Feb 2024 12:39:56 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BCB8DA0F57 for ; Thu, 22 Feb 2024 17:39:56 +0000 (UTC) X-FDA: 81820152792.24.D39B26A Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by imf18.hostedemail.com (Postfix) with ESMTP id EAE921C0017 for ; Thu, 22 Feb 2024 17:39:53 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=SNWTQJxY; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708623594; 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=ZEqwPir77gZiomgrLUuNDH63tTDpLGc+7y089oTBF1I=; b=sFb0NpfLhVyk2M7DKnrVN2/q/I0ozm27O7xV3dwrFs3DMOd34ZWVQqf+8WA3mkaHhkl9Of xYrAI/zlhZZmSQZxDSYyBlWsslCE/06hiaqQjO3orc+XdtcweAgcoYiKnDWr06u5TXY2CC HJinmpzJSovCcPF/rvJD9x/YxA2QMCg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708623594; a=rsa-sha256; cv=none; b=8m6C9IkVyla9m4vozEGMY/e1YuOMmN0Q7BYzxMccnQK3KxXKmjt5clS4XJDA4zKZkCUyWB cafEXZVwSyC2zgb19djX+2jGe5cT+z7G2xKA7gQszcKPzlepbT2w9H0oht/esU7Pb9mY1j UZLkZ11O9hcGzWFYbrHRff2ZXmz4TBE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=SNWTQJxY; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-42a029c8e76so57475061cf.2 for ; Thu, 22 Feb 2024 09:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1708623593; x=1709228393; 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=ZEqwPir77gZiomgrLUuNDH63tTDpLGc+7y089oTBF1I=; b=SNWTQJxYwEGx1wv6iyLgYKjfyHSqTqpShIutthkLfAiFqTwKOGR5PExop6a2Br6W9C OykH7HQfIm8A/zsIajCTuaaywUCnx0NNSXHLmyMtnch+1nQyUaoVYDhYS03WppozuG2e BA2B2nDleCgIX+9a+X6vmNl7+GBD+gLU/HcKtHtO4NZxDOm7T3cf/F3PBQzwYjLgMNPO zqleUgDCS+t69mDHL8fpclqzgY7qhtJBJUk7C9RZbdI4+5aJeIT+2kjwuXAHsLXGNMDe Ki/oMnRkDCFYntYiRz4BtQoqSnMjP+jfrWp9IfdP4S7TxsKGDVEklX7PSx2pkUS1bvtJ jEKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708623593; x=1709228393; 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=ZEqwPir77gZiomgrLUuNDH63tTDpLGc+7y089oTBF1I=; b=ud6s9mVSIh/H7VHuvEU+lyAA5zuFaR9YArnMMSAhDdJd/7HwYEU/Y+jkkq+IKOLlRV zr7EbR+W8sGi1Dy4PaPX9oNcKBm7Fwy+dGRxwg4A7JwV2BJLV/lsYj8h5Wo896cpR6j7 lGVKTkSKSdPUuLGfWjZIJxZEyLS/GtxqeW3ORnRe5a07l8LTHV2kVV5JCZFEJDQyGIxb XpqjmEWsJjxNgG35Th5w9HT/xOlIo7tq01BUdjmsXBh69pW4oOevrd3Xjn6Kzi/oJ1uV OMubk5zcp+vy/M3/lVWzpkL4fkRJz0IJAqPKDxUMKlUvPMi8QBGGa+PcolRSReRX+6h3 ldhQ== X-Forwarded-Encrypted: i=1; AJvYcCVYmLHpNu9VhaHgUb8cnq8Fukh1XW0K1Gq5anzN2l8REnXM39T2rrGUWeoP6YWvph62qMG+OAEsr4pBAXtIGZl8Loc= X-Gm-Message-State: AOJu0YxKhAoNwOMX3yq59+yDViNfndlpsXTBVtsjPQaX6nJX8nKJIknZ XZqMF5ktUqDg4X7CXV2QAXnGfusV8PyIG5X9COCMSMElsYsPnRICXLD8+ZAdSE8= X-Google-Smtp-Source: AGHT+IHWgbe6ipO8HL4XSLjafpdpzGiSGfQct8NtUqWcRWqXLU3Gq7aLBUbxfLYc4BAno8BAqxzaSw== X-Received: by 2002:a05:622a:11d0:b0:42d:feeb:64df with SMTP id n16-20020a05622a11d000b0042dfeeb64dfmr18277023qtk.36.1708623593054; Thu, 22 Feb 2024 09:39:53 -0800 (PST) Received: from soleen.c.googlers.com.com (249.240.85.34.bc.googleusercontent.com. [34.85.240.249]) by smtp.gmail.com with ESMTPSA id f17-20020ac86ed1000000b0042e5ab6f24fsm259682qtv.7.2024.02.22.09.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:39:52 -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, bagasdotme@gmail.com, mkoutny@suse.com Subject: [PATCH v5 08/11] iommu/sun50i: use page allocation function provided by iommu-pages.h Date: Thu, 22 Feb 2024 17:39:34 +0000 Message-ID: <20240222173942.1481394-9-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240222173942.1481394-1-pasha.tatashin@soleen.com> References: <20240222173942.1481394-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: EAE921C0017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: dnodapjfc9na64z56canbb5u87ipbk3i X-HE-Tag: 1708623593-175252 X-HE-Meta: U2FsdGVkX1838mwzumuDNC0MoqZf2gyEX7aoHtxhY9v2oi88tVHN6jOAvHtJgfRzU8FBSHvEKvVCIeZyg7OrMOTwGnY8AlvL+avkbTY64401YLCpxkNq3tc/Oik5Jd6LT6PYCR+ExpaQgNOU5GdR0l8+yqCFBL2Oj5vsEGqvZLTJyGgg4ZKvYKKNdekzgFP9NWleZzMQMQZOM18W8dl69kLqPworJpu9cjNQPkiVZnknHtcpOn9mbf97xaOVFUyHe6U5FPpOr5bcus4sbXqNG6HyQkNp5x3NJEwdNZSoq7oEPQGlkZgNMa0cYKMb3OSmfEBSDQotCMT8SUP2hhoDnmrUh/atrnCADy7mTZEp8/k1dBNtwxOeLtSR98C+f/tX0/pP+vnFiwGeKrlqw4M6voeuJn4+rf+h06ejb3RP+ayIjBqXqp1Gy4bA+CjQa7oPgUG024ShOt59Njs3nM1iD5UEJhLDKuumKqQB27ea71JQOOm56FZWvKLUFF7xjnX3fjfi+b2F1Zqt3khRXxyNCct6YRg27xBA2BVNuREJhNPUcL1Nnal0cof9qU8VlNfn2ncQhRkMyzY1XH8MgCfanTPZX2/IBuBRs4eEo1xRFUVNPS+vofvSaJqwqk2CgwiOCk0kJLyEtCbPL5ss7jAVuWzLu66wvcnkowX0AZ/GquRckHg2Bh1aAwTBSS6wW8eiQo0Ig6Q3a1BnIFFW6bigyGPtEnlvJPDWxVwyLMtT4M6FJXQvoFDS2FkX5MbFopwQtzVjWVcL8IYIuvEgmgg5mbnXa1GVFYY719MSx9EpmkWfMQFn19phbesXkqX39gSFzZTm4YBTeHjUFlaJQQaaoCTgSNkV11nO/z6/NhRrZKeEbH87U4tfwJKkmLo2eTde7iNh84WvY+Xx/Meyi/xC/QVk/z21hMnhFJzmUzzWYZNHZtHL5tng3P855/uJDz9QrIMivBdJrujmeyACbVL Po7igfkU qkB80HZqfglU7ojdATvZbifNkwdsy38LPxB0BKilvREWfNOAbqksG8cZtmagmMnNfLoVf0jtREBd4NNbowBPUQ8QDHhVLCZAZzSNfzWeIG5SHFpnsAgqNV6pVINC2YuJuF+2KKNp2VSw+fTnvR9g1vCOGz+AhpAW8blCaLrMwG2O+NgXGSZDi7oljR5NYZrTV9wavJE+h6Vyu7iZ30UEh3Do545xgctDMnxrCt4kh4hvq5nuJCbvFa26cA6+j85XWurJv3Zj15WBiVTSBtgMLyr4RnuLVgA9BopOWmGW95EY9b44bFHMaO8UupMF3dP9JcW8EoOK5hBqvUKGZ+kD1LuobOe+HQQA9rUOuo5HjBnw4wnvNiP+k6++JDHgqRI/58KDXym6ElMqnPMqBTYl5f2LxJ4UVXo0eXGwEhPIUIFd3woj88MFwiz0wHUVsKymI7DAL8xboWlnj11Lq1E+uQ2mqQq3uPT5z8EaURh2brd2h4uo4/z69xhnGsoHxQAl2In1UZCN1YHMR2A4foc5r6hVFUlGCITxAOMVFMTxh/J1G+kcVi6VBA98XASi9EkAzemFHsXfp9dAYyMY= 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 Acked-by: Jernej Skrabec Tested-by: Bagas Sanjaya --- 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);