From patchwork Wed Feb 7 17:40:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13548807 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 AAAFCC4829C for ; Wed, 7 Feb 2024 17:41:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 556BE6B0082; Wed, 7 Feb 2024 12:41:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5097E6B0083; Wed, 7 Feb 2024 12:41:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E6466B0085; Wed, 7 Feb 2024 12:41:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1935F6B0082 for ; Wed, 7 Feb 2024 12:41:19 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id ED6E8A071C for ; Wed, 7 Feb 2024 17:41:18 +0000 (UTC) X-FDA: 81765724236.11.8E32767 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf26.hostedemail.com (Postfix) with ESMTP id 2B346140011 for ; Wed, 7 Feb 2024 17:41:16 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none ("invalid DKIM record") header.d=soleen.com header.s=google header.b=LOUTKgvx; dmarc=none; spf=none (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com has no SPF policy when checking 209.85.222.178) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707327677; 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=wfVh0oPEahUZvzrBZ9xf+/i5rxN2+U5mi493evzNcuQ=; b=A4Zv1VmcLNlV4zVjRSarSCO7pilZX/SDn7fK9qwd+pblGj4uo28wn/iOq2x4Gr27FISHht hYXY6uUz4OZHxZWXZW8fjEvcHTCf65k8HhqUxY99iinr0X4d6qYw7DvGR1i6EbsWCHuDiZ +rkNHz1Y4+tjGORbFrWJfXw7qbW/6Gw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none ("invalid DKIM record") header.d=soleen.com header.s=google header.b=LOUTKgvx; dmarc=none; spf=none (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com has no SPF policy when checking 209.85.222.178) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707327677; a=rsa-sha256; cv=none; b=vEOok1jVPCmpvOp+nPkyyF04RorzbCCaxVqWNaSumXCRTwvCPMskyvBQ1cOVIWdjTrZiV7 EVZgDgDPvZAPRAvFZ3Uipu3pGuWpG5OjbiIx79/cw8UhKyjwQMDXsbqPiOJkgfh/pGm1Fp xYVma7GJdiQZrHYIKa17I4XeYKOU9Eg= Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-783eb452e01so5232185a.1 for ; Wed, 07 Feb 2024 09:41:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1707327676; x=1707932476; 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=wfVh0oPEahUZvzrBZ9xf+/i5rxN2+U5mi493evzNcuQ=; b=LOUTKgvx+cAvfmWzYXbVPl5AqiVxjxQ7JaxG25H3iRlm2sskw/fr1FOXjwzJKQ37wI RkfMJTJG5+USN9hOL8gT+BLMGLlzjAwtErhAyn/quF6s47opzSBlhBJngtD+W8wAn2NG K/OsfI6BVrKQh0JTLuvmBfEZNA8A8uAWTjfL/5dxbpqe5vd9V0NPU1gMh6v202xGYRHo SYamymjRHu4jEVgtKxhwyqNL8qELG/Bg0/wacP/EB3CPCgqp19TxfNGoSt2NbE3tiJXC VAl+MuQVTzIUbZk+IynD/x5r5R5LbhrJ9XEUnr+eR8EcMCdIqHmgJ5XEKzdW+fJou/wk 4Jmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707327676; x=1707932476; 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=wfVh0oPEahUZvzrBZ9xf+/i5rxN2+U5mi493evzNcuQ=; b=iS2CnaUIDi54VmKBuIYe7x6sUCBm6n0pQhHfHvke9dYIoW3UzR+SOmJtHr6jBsvczO V2V7u6xgywo1zFAX+VcFKEBxBpEv1aOfWKTfOKJ0O/HKWM8STYKxtMN2mdyirrcXbIKs lElzLn7IY+EtCMvBtPxhRCpvlVxzx7Z2H544gCNEyiTIkg5KL6yLMdytRmP64wefWLnC pSsQJyO6d/rVbDZe97LoVoBZe7VcAfRbmiF4G2uU3KA7KUCSM9ryf2NlmFf+c7sWSA8e ejWZf+pp7vEzzhenNsdEDWboJlnTVCosvgEjMTjzVGIyaRMQGTmW1clHWW9xe9e/iT47 ULeQ== X-Forwarded-Encrypted: i=1; AJvYcCV8G4POvAd/3yJgDVz/8iqg6G5SctPz2CB8wAheAfRnNldCqoKYXFG5WsU6Rt31Cl7Abl04E1Zq3NDEHWnt/hgCvo8= X-Gm-Message-State: AOJu0YzL8wIBXom1vZVw0xsxd0/vhqWntnDW0HUdry3bOXfElpmUQ7Ma 5zjQoVNVcIrvFUFfhkYGsbUaEJ4HrUZd3WFnK5BtEpRkfU/iabQJCJB6LjO/eGE= X-Google-Smtp-Source: AGHT+IEYw/oN3ccwsdwQFv2jRl2FvfT6B6nkPyMXJGG4ZBtYYD02TxlhcFEf6LXGuUiTE1mdL7ys/w== X-Received: by 2002:a05:620a:2191:b0:785:a0fd:26c with SMTP id g17-20020a05620a219100b00785a0fd026cmr230165qka.36.1707327676289; Wed, 07 Feb 2024 09:41:16 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVXXSvczqKSyNm43JX5/tzjrxJXXar4QNtSDMhqU2+N72ON7heLA3zeXwN1sPD8iNP1Ua3viph4VSvSaigEeBs+4AB16FSQoHG3nR2ARKpJ6Z6eqdW6RZ/Dx5gVULGUeNiZJs2bmFqEcerVJIR/k77MlP0P0vb2m946zLj3/Q+KKlAaf+S7e+fUwZ84VZBAoIKR3CAFqaEvfgSVeHvJDNlreq4nUF0bRbOmv+CTFkg6/34uIuhSrA1PfBuZS9NDpUrr7qD3iWEui7dadf1quYchsrHJm7Et0JCMwNo5G7j88fU0jnlH2f3xq6IprlzgVbwgVawD+F0w5yMxaKe31AMQCKLJDPkDnYGtso1cb3VcL9cwUUlE8zHdYGqDtmL4A3bNsEc+cHEYWlAikX+B5mca++p25pQQybiJgq5+xuv6MXn3SJAmkIrOedVuJQIGWWxUXhVKrHyW1vTefklNntllKnJ8kE94Q2QK6FQ7R5hbS7ZM+HnDQX4b8eU46NlXSODa0H04teVLWvmP9gtCad8fAMZqMrrR3WQ/TUTBO30OMZ3zF+k4DWHX9SXVVrt9nrRNprKLO9Z7u8dKJ7+GXLD3DWJoiQaPYhHwdfNS0J/6cWv0Cmhs4GVlXWvAwjKLkG6R+bd+Ys0jdTkMgWDuLUuIUZJXKs8G2j8ytxUN9ONqBDbvEtiqVgUbhqFtknANpqKIjtrOa5afMZB6vaVlSXSz7JIia1p4WLqYg76UjL26wPfE+YNYaoqoyla+/NM5tlqcG+Qv9qaBsUT0PrZlag/9hIB7OlkLkbIDeffOo1piVsMnuWQ2Fb0sIE5M3tMlSV4LOUvlm6MMoqTigjLdoiMPCpo3eSydh5ThPXQcdvauDs1iooRO19ROz7wfGQiGkN433FzI8pQIGwB/Y28HAGJ2Z/e4dzgMME9mxSg6/v6VWpPcpYfrpADNnE1HG5 m17F3Z9/ UwJNwsxkn3pX7eMFA/DZyCzVr6lCgR+6OWns+GLU2SxZUdU0xVvSfjQhkSCVyzsqGTBKOAl46Qb5IR6uUP95vhYRyZh/sazLK1hp6TuSuGwGRiqCEq3kw5QrDYNAeSeryfxDajztI6S9jiXf9iOAeZ2u7rYaFZy50vg9l9iMXxf9hkJco867096dyje+DKkhn4WuJV5pUKUPg0jyDyOEh9YkiepVTHVZe+2/e6eXAACmAIqtLN291FEcNxHSFVc9VoRJotuYKq+P9z10tdNS+gaUUxRVwOH60jk5JdNq6iqwWPhfb90cWSdU5X/SASbKNAWT2TUn7fb+cqTPdJqZU5F61vo4y6m5LgEiIZFuY8ciAZqGeXCJ4KoNYNcloHQYen9MDAb9yvPdMPytSIThAuivd6JL/t1mQ68T7pjNDeJUQ62Bl8xjmJOCkONVL1QfNYzX6G15djtpimeWhgGmyglvGJqsqIKWUnJObt/eRFoB8y 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 e10-20020a37db0a000000b007854018044bsm696310qki.134.2024.02.07.09.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 09:41:15 -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 v4 07/10] iommu/sun50i: use page allocation function provided by iommu-pages.h Date: Wed, 7 Feb 2024 17:40:59 +0000 Message-ID: <20240207174102.1486130-8-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog In-Reply-To: <20240207174102.1486130-1-pasha.tatashin@soleen.com> References: <20240207174102.1486130-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2B346140011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: dgq8nu6ty1ynwxdpbgjbkfmuoumo8hh7 X-HE-Tag: 1707327676-928666 X-HE-Meta: U2FsdGVkX19uVj9IGKcqNtIs/sbW3oWbv1/Nx17LICpQapz6DKBQUY3Rd8WEkT85hOxDlvVjHA/qnyIfM0ow2Tvh0KQbmsG671V1QCqRtJ2jT5jcS/p/da7irZanasN4xDoo/rCk23CDtH/C8CzSu/zTw89uh5S8mDGmvOGCNza/KmsBXtHZxQMZTNkDoQ7EUZ21jdpJT3GYaHlyzch6GGQH5jb66981UOI2uWGPsahyKyxCiQqfCVDhjRD2GrvBDVaVeMtMslUHv/3qoCZeCLc58KwHNBk1ZTV4KxG/LWK3b/O3qv2TWWzDMylrSsrYnCcJQxazPNxX9GM2At6Z5Kn4dqyiNuOfUBlEnfE/3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OfvKo 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 Tested-by: Bagas Sanjaya Acked-by: Jernej Skrabec --- 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);