From patchwork Sat Apr 13 00:25:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13628431 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31BAFC4345F for ; Sat, 13 Apr 2024 00:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yWL7//tj7cfcvc/qtu+zeHG0hxJNOKFrZBltSwaZEHs=; b=YAc1NvdQNOUobr 0IOiLpBleN1ZL3TPCZcggjMLJCGKuyuiTm+bcps380knfIbQWbBjB1rFKsyczAm8MUeOE06wCT0rG 4mD4VxMGD4TgpfE1gCDYcYXs0CtSXDqkGXVEteOYyIMedgtSq02Kb55XhhQvsz1l04WYFk93nH0hw HS1uspj8T532MCPXRawa9vbM67B4awBw3IzX628ONlTb8rR2niQgmcIzuf9rJNVIU+lCUQfSVaLus fUuizDotpSzYl/tpSDTiXt2TFBHwZBjnhRkGkMjVan/0dFxLZfS9m6O/s/2KXlKlNcTj5fPiCGhz2 4oWKezuDFk9wGdFXp+UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvRL0-00000001pzH-0xvE; Sat, 13 Apr 2024 00:33:46 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvRKx-00000001pyM-1w2a for linux-rockchip@lists.infradead.org; Sat, 13 Apr 2024 00:33:44 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-78d778e6d3cso90615685a.3 for ; Fri, 12 Apr 2024 17:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1712968422; x=1713573222; darn=lists.infradead.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=MO45TG6xfzZsYhTVPnL09wSWtApUT5YGrrbgII3maTY=; b=GWHWysn7AlPMJPp02t9rhr/Gep3o6Cs40whEFL1plbL5Z4M6EGD3MTW1OeFCJTqlbj vzBwXt0WoJEDrj32YR5nHWhOJaUc5dnBU7mleYKaU48xTRryOelxnNB+WXLd91Wp2God BWdkJWA542t6FpIF2US0vrQdM8icJgsyYDiMwskG38tyNdnUXHzIYGMQQDiNCEwNedT0 Tx+59CvyK76Muw/T0GHND30jdFUeSvqEBXvq7VV6MAAL9lV5B5fgmnbaq2DSWn+RaACL YALlD/smKFaIGqD6IEDaNQw9obt525lki44wOy6H8fSmEf4TlSYsj7CSDFl7THr1yW8y Mf4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712968422; x=1713573222; 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=MO45TG6xfzZsYhTVPnL09wSWtApUT5YGrrbgII3maTY=; b=XXzSxNzuBLjSnmU5eHIJbtqtrBUcgnjD50x7u5lajfnpHNoFIkH1Qb4vCfh20WKkvN WJGrlm0qE0fRTuJ8tbgEWyVdluNhyYiH7tXusjM2Uo+4czavNLuIXkqxB4peC/o0y1b1 mbcXyQ0fUQFvFjwHXMJCQfEbPAmiNkLGJVKfuvQkUjjkjaIIpEBlOSOHfhsU5zdRvlIc ESJJ6XMEizmWCBo5whTP2yMluOSohzGiTYIjX/drQPsIHvGQz/V7gFJHfeeHDizSqQuw /rkTWsaOrWulfp4xF5ApCbTNFIc0iH0yru7cGfIqpz1NDST2C0xF6qF/61cZBKtPHVBA 2yKA== X-Forwarded-Encrypted: i=1; AJvYcCVUHHzJEd4WFaDskxNiiRRn9XcMsp6zkWTNbqi/EUlrqJxBlCmYbE/jX4Jd5sm8v0PFtf1m+VbK5Uf+9onG5Sc5X5kFW8AjS4C13J4DCNddvve8 X-Gm-Message-State: AOJu0Yze1oOFdH07ELNo45uqb8m3NmB39nRsdt/8LeY3eLGysNvq8F/s cBIQrfZ367SK/KA/6h81E1O+81YAANTt3yU9j/teoRBs0srOPlKNGV3hkP5MZWXgEFTJshSgpkB C X-Google-Smtp-Source: AGHT+IEXUm4h5HemGXduoWJF1eYDhRYKVLtFqnvpNR6ns26vxx0/EdOeXta2X/OaQb67WRloCqHbfw== X-Received: by 2002:a37:e306:0:b0:78e:c0f7:54fb with SMTP id y6-20020a37e306000000b0078ec0f754fbmr4866171qki.50.1712967933251; Fri, 12 Apr 2024 17:25:33 -0700 (PDT) Received: from soleen.c.googlers.com.com (128.174.85.34.bc.googleusercontent.com. [34.85.174.128]) by smtp.gmail.com with ESMTPSA id wl25-20020a05620a57d900b0078d5fece9a6sm3053490qkn.101.2024.04.12.17.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 17:25:32 -0700 (PDT) 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 v6 08/11] iommu/sun50i: use page allocation function provided by iommu-pages.h Date: Sat, 13 Apr 2024 00:25:19 +0000 Message-ID: <20240413002522.1101315-9-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.44.0.683.g7961c838ac-goog In-Reply-To: <20240413002522.1101315-1-pasha.tatashin@soleen.com> References: <20240413002522.1101315-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_173343_508721_27A92F9D X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 decd52cba998..c519b991749d 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);