From patchwork Sat Apr 13 00:25:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13628394 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 4E595C00A94 for ; Sat, 13 Apr 2024 00:25:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BBD386B0099; Fri, 12 Apr 2024 20:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B6E2D6B009B; Fri, 12 Apr 2024 20:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 997B16B009C; Fri, 12 Apr 2024 20:25:34 -0400 (EDT) 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 795AB6B0099 for ; Fri, 12 Apr 2024 20:25:34 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4505616104F for ; Sat, 13 Apr 2024 00:25:34 +0000 (UTC) X-FDA: 82002614988.28.AB18883 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by imf13.hostedemail.com (Postfix) with ESMTP id 8B1772000F for ; Sat, 13 Apr 2024 00:25:32 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=zhNMZ7x+; dmarc=pass (policy=none) header.from=soleen.com; spf=pass (imf13.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.210.42 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712967932; 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=63yVyQgEqo2cT7rWVkBtS9/N+xrka1mo9DBNzoSqbsM=; b=ljGTlTfFTTUkurkdpUR8L3DvZmbnzrU/jqtmiXjyFMG+6PWc5KCrgFj+7gA24h8zQkhcdf WRjbbhT0I8NpchN7FsQIuGZRB2ssdvBX6cXUDp+abhrHz5KPyAwOZmD42kQWz//tvZe2uc MgWbAqQK9XXPARk1wWFpzyZZ0MOhNWk= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=zhNMZ7x+; dmarc=pass (policy=none) header.from=soleen.com; spf=pass (imf13.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.210.42 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712967932; a=rsa-sha256; cv=none; b=FfiF90CGDhjjPz0BmsMXd9INaaJD53Z6us6lqLNffuaPBFCyCwmSzUq01l9Ot0kMiXuLo6 QGcbZ1DbyRybCq/tAIoY25G9VjB2hgNZnA+MYiUa6u+LKIYpfxOSKChKKASqzT1rGdU2kH AXKIJ+SS02/Atytm5d6G6rZ+Jr75kCw= Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6e0f43074edso1069062a34.1 for ; Fri, 12 Apr 2024 17:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1712967931; x=1713572731; 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=63yVyQgEqo2cT7rWVkBtS9/N+xrka1mo9DBNzoSqbsM=; b=zhNMZ7x+ZFqD0tqloj3hrq9BZtWH5GSXx/bdZU2EPm9CE52LZkHQ7vt3MP237Se3yK 1oC2XLka6c5ME0my/9TTTKawIyxoSIidwRlbekRLyA9ucf7Z8R5i9IEUf8NmdpvLZchg nIC6YHx4ghSkrpMu4drTAfP4rCk3sWL5NnrfsLDasEDMUxNpGe7Cz9e/MxSG1TLTqMwN /FgBnlVAJOenWxAl8CUSVI3gbH3zDT+V5y5S3iBy6wdlfndmaemG+cavJ93vft7hZTbe jrqCgj03rDb/LL4nSg4Ez78EwMZROzyUpqb1LMXR1rFqEaZZ/scDyq+TPqU2+eYnsxh5 z6Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712967931; x=1713572731; 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=63yVyQgEqo2cT7rWVkBtS9/N+xrka1mo9DBNzoSqbsM=; b=cSuIaagueLnAvBKc4HbFf4huI+bfGULAaYkfCY5iA5hBN1RKAo9VC2bEZghR2eByox BIXX9GD00M4VNOaWa6akWBmdgcmQyHLUgMQZijmnvpR6n4W5YLD1LhsSYleTRs1d9tds lBoBMOwOfU6X5vcwVsiX0BdbOJzUnrZsOvhJ6J/+OWEjNTX8qzVXRL29BnvuhYmQPK+E lJ+ggTjvB0J/yxVoew7ECWrG9xElO2F0chK4fUqjJWE6j2x4HeVyTIrJdJ5vxrLxQVxu 7lLvayJS65j6I8AdVEgpX/USLgWUfsJ97q64g00KQdM0JQOg59+9t+1QA1qTX5bDDvwH FKWw== X-Forwarded-Encrypted: i=1; AJvYcCVP1NrQTcEMKMrHAiIYvAHcIS48Rn3Ure7kZQys2EmvrfAf7GdPPF4SsTAiLVbhTssf4GqEq/a0z4+yPLtgz8QQwCk= X-Gm-Message-State: AOJu0YyrqufcbqANS/py496SDIxVhC/G83eWfOBH5GeaNJ4EtpSHM5Hg UqcgoVEQ//8VSPCVqnY7N9HQwuAk4VmQaeE55KJzZS4ggzERcW1My201UZ7cvUM= X-Google-Smtp-Source: AGHT+IGmmSLufriFZ7xkUlQYwmHrJvWk6RRFIShCPmF9PtgFnBnMl8wu2EFFWe8ZzLIq79vC6G5l9Q== X-Received: by 2002:a9d:4d87:0:b0:6eb:5654:d77f with SMTP id u7-20020a9d4d87000000b006eb5654d77fmr4234028otk.15.1712967931426; Fri, 12 Apr 2024 17:25:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 17:25:31 -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 06/11] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Sat, 13 Apr 2024 00:25:17 +0000 Message-ID: <20240413002522.1101315-7-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-Rspam-User: X-Stat-Signature: r3ekwko163o99j96yu5w6w7bs8donkha X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8B1772000F X-HE-Tag: 1712967932-392339 X-HE-Meta: U2FsdGVkX195T4Ou259zW39Is/48gW26XAJhrcJ9VmD7H8RfDMzShMwJonqnZLv5i81QakJUHQujzS8cwScglLGM+NE1CNdktCjMqAj1TnJukBCknaWGU3p8KKoXktY4Slgy6O4s5O9adieMPabfdbN905p0ih57hfAORR2OsegPi+ZjIYxjXBGWjoQXf1etvT5Ncl8XMwvJgf39zLNNvFrgvRehphVMHNRbfW6R5PdiDxsu88BueKr+0q2NXl847JOBidWQRmI0GE3WHEyWNmR5iyKmqTXveYfNaP1W92nvZq3jWai4FBpg+pKL76STcvIJtPSxpf+l1i/DLr05+TpoD5KksTymiTPPYptVw47Xlw58BNCZc1lX4cC0JK0axIE1iHfxfuaiC+xRDNtdD75ZM8vUXuwq1h/x4o4Oyk3mkvrdcnb5MPjfn4g84nOl4HO/Oi+J04j1ZIvdCSK7gEF5L5Dt5IHyO2PwMmBBCE02oo+OwcQcCLwjwzWG8keUwWm+6BuEhxrBkR9pX/ckT39lKgppzksKFuGrHfPQ0AG5wiCvBHJGXlkd33FM81xPO1WmKh7il0flhrbynWyl5Y3eeUWha20lonVZD9GjAynG+HBrqIPqU9Si149pQxuo4A5u04UhjbqbNS3qLMyfBApDzYypYBuaUcopJOtx8B21LXCXeejECvKMPhU1E90v95HC6TRg8TgOBueqK6IOQ0EP3tWlyuPV6bVaUaCWjRZEz5sEc4CYCPEJ+epNWY6UMMC0qWH2wCXVK7NyNtDTLa7k+5QEhBmlzqUKRb2MCTerVW4S+pHLNi7a3LY9EYKE4bB+ouONaFQJKmg8VeIuluEL6CMb+SbiGMQJ0QxXapAGYPolSsd4FyKmjYTecFwcvt8SVw2w+Ii85Seol/W1cJ4/qQ9268CX42VF7boj2S5DYtkUNTy+yzZ6nI/YCznhcZKm1OS0D4XKpYH18JV S0dhGAMR LS2mtD8WXhQHc4Yedk2YPQR/9hzuhhURRVONYhVTC46dIYo4g08+WXP16GBD/0hpz2COpLYareylvm8YASNZE9pBmR8aCZ+CWpaREe5DEKQyEtuQ3MSWb7LyC6VLka7e48pMrSK1ijztt9EU0/LaMASf2Db7z1GM0g0L60oMNfAZK4kTw3fizdzuH5sewct63bNShErskk13wz4egKInZAA1Y3WQV8jVSYy9ngrNi1mRqI0/xCUMSODVwG9DsOg5KSg2/zLWJ9DLLni0xNGG8j4W6SUUFAfn6CjYf9sf0VJDTEqgABQb6xU9EEZuN0PJWvvArIkh5P9Z2BO5AF8ukEGZXznXukItlcjRFl50v0c+qKfOMVO0OD6rlPDOeKFbpXg9Xwo7Cgsnp3yxv0TTWjeafCxW7A1nSi6VrRxSMQRNsTWHi8pNd8yt5QUC0VwNU9a6djcULKdVZkI9CmyO/KQiYqr/Z0Rosm+2FPuFMQQammNwN8oO2kuetDd7tNa/autWtzZxJexXRaRqd21HGwOIFlm1TtTmAo/Xim8FUr5lw0nLzyc6xu1k/nZaKKJ1qSp5ifU3ZZdsGcJR0ZYTCF3nlsg== 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/exynos-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: Marek Szyprowski Tested-by: Bagas Sanjaya --- drivers/iommu/exynos-iommu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index d98c9161948a..c666ecab955d 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -22,6 +22,8 @@ #include #include +#include "iommu-pages.h" + typedef u32 sysmmu_iova_t; typedef u32 sysmmu_pte_t; static struct iommu_domain exynos_identity_domain; @@ -900,11 +902,11 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) if (!domain) return NULL; - domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2); + domain->pgtable = iommu_alloc_pages(GFP_KERNEL, 2); if (!domain->pgtable) goto err_pgtable; - domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1); + domain->lv2entcnt = iommu_alloc_pages(GFP_KERNEL, 1); if (!domain->lv2entcnt) goto err_counter; @@ -930,9 +932,9 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) return &domain->domain; err_lv2ent: - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->lv2entcnt, 1); err_counter: - free_pages((unsigned long)domain->pgtable, 2); + iommu_free_pages(domain->pgtable, 2); err_pgtable: kfree(domain); return NULL; @@ -973,8 +975,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain) phys_to_virt(base)); } - free_pages((unsigned long)domain->pgtable, 2); - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->pgtable, 2); + iommu_free_pages(domain->lv2entcnt, 1); kfree(domain); }