From patchwork Thu Aug 3 10:12:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Shavit X-Patchwork-Id: 13339657 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 D54A0C0015E for ; Thu, 3 Aug 2023 10:15:03 +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:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=eORrEC7vasehgLHnVXH8Nb3FpvPxBBuGJlPZB6KRHLU=; b=1Kjkv9idEPNRHMGnNeZnEkDBBL 12gngsso5l34DZvyR3wlm097gkXH7iiHRsYQ/pYKuyEClnFlflYJCrEpoGHFojFHAhSSo1/EviPUC k8Skcvu3bOvJUbQqd1r4xglfCbh8c8NvKs8kV5M25v70///I1mDYxknbCAATKuIz7iyRW3srKTgW+ nr4vs62IL2wUwShAmi0PnwliHO8ZaIMaNsJjOkr9Hfa0vE5cZNx28n7NjX1bIRI2D+xSo2BknhcVt 8ksqPGEiFPCpg3Rtvs5eCiqfzN+ieuhKjiMwZT/zdyioqnesOgHosv6niEmm0IVnpmEKACj2VTVpj K41tAK9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRVLq-007JqT-0q; Thu, 03 Aug 2023 10:14:38 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRVLj-007JmO-2n for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2023 10:14:34 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-583c49018c6so8433057b3.0 for ; Thu, 03 Aug 2023 03:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691057670; x=1691662470; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DLa2HUSCTWFTI0X2o3f102hvfCfHBN0tK5dUlzxCyIc=; b=a6jeCmc4bN/A2ChgfTwyYgnoSOjzynwD0hKdab97fxFiQfSeGipLdBD8vrco7vSA/g QOt22+Zq6NX8xu96ciZpkKp4t5eOm+ZaDlxM6cwB96C4VYR8qRCGUhy2F8aLjmrZX7BK lgPFNpSbNKKYhMqQtdmKUOe2mtgb5tKgGOgDmq9z4UUNQSfYVDQitc/nmlYflTh8r71x WHXjiURsl1a7dnvRWS7u0ZIp9NkZQ7glmppXYAaIMaXGtS+Nd08ghmzEF5M9LzrJXJmc KqvH0cWbBfcQls+aRNNfkuVmAcdzik2ZO7MoKwsaPcJ6aKQIAFn69fAb4koX4ECdcQQ0 esCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691057670; x=1691662470; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DLa2HUSCTWFTI0X2o3f102hvfCfHBN0tK5dUlzxCyIc=; b=IV1SVoOpgsiJyX6Sg6JdL8CstuYtDoDWsPBASPQL3R8Jst3wqvm/xwgbGZ0dAEZtY4 GEAIAxEg+xsEGXKDjCMS2cmiVP5JgMggg+7lZgK/JnJ78ySLZmOjLxWCGml68vPCTjzx 6DMuTepHZxXOrLphGqsBzQNoTj/4Ta8wcGLB83kIoweCz2gUW7LFxPVp3KFeYtP8hh6e TZr+xKnB+5fDGynYcIG2ATwBwD7FFVW4KoO8A3/Fus8MgkN1PLUBydkTD7wNHiRq/dbW mKXEONp4h1Y6PzqLYyRTnTdVGv0YrZ2pPQh6JtShbkpsgeBKD4gYgxZJcK6PmNR+f8aF KXGw== X-Gm-Message-State: ABy/qLYAWGnN+gBZop4MJ5isNRskFmc2EKSI8soGeR9XsnlmAshtuECs eZUYrn556GOzlA9ERA43Ulgp3VBjwnMB X-Google-Smtp-Source: APBJJlH6RK3TEtZXk1xM04qItMlyJrFzxnsOEH42ZDuBzo1V5QaUS9nSNVNbePa1fe9X8ZQRJ7o7+n5wLnH3 X-Received: from mshavit.ntc.corp.google.com ([2401:fa00:95:20c:39d1:8774:b733:6210]) (user=mshavit job=sendgmr) by 2002:a81:b625:0:b0:586:50cf:e13f with SMTP id u37-20020a81b625000000b0058650cfe13fmr100164ywh.1.1691057670282; Thu, 03 Aug 2023 03:14:30 -0700 (PDT) Date: Thu, 3 Aug 2023 18:12:26 +0800 In-Reply-To: <20230803101351.1561031-1-mshavit@google.com> Mime-Version: 1.0 References: <20230803101351.1561031-1-mshavit@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230803181225.v5.6.Iff18df41564b9df82bf40b3ec7af26b87f08ef6e@changeid> Subject: [PATCH v5 6/6] iommu/arm-smmu-v3: Cleanup arm_smmu_domain_finalise From: Michael Shavit To: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: baolu.lu@linux.intel.com, will@kernel.org, jgg@nvidia.com, jean-philippe@linaro.org, robin.murphy@arm.com, nicolinc@nvidia.com, Michael Shavit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_031431_901740_521F8E8B X-CRM114-Status: GOOD ( 14.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove unused master parameter now that the CD table is allocated elsewhere. Signed-off-by: Michael Shavit Reviewed-by: Jason Gunthorpe --- (no changes since v1) --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 5fd6c4d4f0ae4..db8fd4b3591b5 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2129,7 +2129,6 @@ static void arm_smmu_domain_free(struct iommu_domain *domain) } static int arm_smmu_domain_finalise_cd(struct arm_smmu_domain *smmu_domain, - struct arm_smmu_master *master, struct io_pgtable_cfg *pgtbl_cfg) { int ret; @@ -2167,7 +2166,6 @@ static int arm_smmu_domain_finalise_cd(struct arm_smmu_domain *smmu_domain, } static int arm_smmu_domain_finalise_s2(struct arm_smmu_domain *smmu_domain, - struct arm_smmu_master *master, struct io_pgtable_cfg *pgtbl_cfg) { int vmid; @@ -2192,8 +2190,7 @@ static int arm_smmu_domain_finalise_s2(struct arm_smmu_domain *smmu_domain, return 0; } -static int arm_smmu_domain_finalise(struct iommu_domain *domain, - struct arm_smmu_master *master) +static int arm_smmu_domain_finalise(struct iommu_domain *domain) { int ret; unsigned long ias, oas; @@ -2201,7 +2198,6 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain, struct io_pgtable_cfg pgtbl_cfg; struct io_pgtable_ops *pgtbl_ops; int (*finalise_stage_fn)(struct arm_smmu_domain *, - struct arm_smmu_master *, struct io_pgtable_cfg *); struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct arm_smmu_device *smmu = smmu_domain->smmu; @@ -2253,7 +2249,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain, domain->geometry.aperture_end = (1UL << pgtbl_cfg.ias) - 1; domain->geometry.force_aperture = true; - ret = finalise_stage_fn(smmu_domain, master, &pgtbl_cfg); + ret = finalise_stage_fn(smmu_domain, &pgtbl_cfg); if (ret < 0) { free_io_pgtable_ops(pgtbl_ops); return ret; @@ -2429,15 +2425,14 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master) } static int arm_smmu_prepare_domain_for_smmu(struct arm_smmu_device *smmu, - struct arm_smmu_domain *smmu_domain, - struct arm_smmu_master *master) + struct arm_smmu_domain *smmu_domain) { int ret = 0; mutex_lock(&smmu_domain->init_mutex); if (!smmu_domain->smmu) { smmu_domain->smmu = smmu; - ret = arm_smmu_domain_finalise(&smmu_domain->domain, master); + ret = arm_smmu_domain_finalise(&smmu_domain->domain); if (ret) smmu_domain->smmu = NULL; } else if (smmu_domain->smmu != smmu) @@ -2462,7 +2457,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) master = dev_iommu_priv_get(dev); smmu = master->smmu; - ret = arm_smmu_prepare_domain_for_smmu(smmu, smmu_domain, master); + ret = arm_smmu_prepare_domain_for_smmu(smmu, smmu_domain); if (ret) return ret; @@ -2541,7 +2536,7 @@ static int arm_smmu_set_dev_pasid(struct iommu_domain *domain, master = dev_iommu_priv_get(dev); smmu = master->smmu; - ret = arm_smmu_prepare_domain_for_smmu(smmu, smmu_domain, master); + ret = arm_smmu_prepare_domain_for_smmu(smmu, smmu_domain); if (ret) return ret;