Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp321916pxb; Fri, 15 Jan 2021 04:17:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFWKq1Zs87GXbmlZhkkkUCME9DXoJ33aNb1OXFcxnFz95SrA0QeZUZqlE3TaGuaLSHXiwl X-Received: by 2002:a05:6402:149a:: with SMTP id e26mr9759581edv.150.1610713067375; Fri, 15 Jan 2021 04:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610713067; cv=none; d=google.com; s=arc-20160816; b=TopVL5SpdxFoBOlt8ON5Lh69v4P0j7ZGB/5ZuoOKOxRTdN1rN1/Ire81jLBbZ9DulV pA53y3E93bEENqJid4ntHwbrVOUlcWhcgUX20xSOIlV6VTd2CrCvcKNJvm9+u6vXuSqj 9uh+CFXiZo8lcnW4Wa4VSszYERotOqcB2yLxDAzkC7bu2eA7khNG6kY6JO0ghcAH/9A3 pVHPLVopxNdG2tIgC+Q8jwH1L7WfiOPJNfbdAfSw/GyvLPrPknt4Lcy5jb/u86+9/ZXx CMp1bw8OYukfpxP4yONbzFVbuSxSInEJznf8TMMq/u/DOaJpvOTrcEr5rPjJu6643TGQ slfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=RburR7df0YAwmVrFHxT6mq8eNNp916LPDHVzbX/iU18=; b=GdZnTtlln9pcoX+SIpAEy8AtalnURcSjy6SUBfbNBB3YK1K1sX8nhAHlG9XEii+IoJ UCUJpdI9OYaPK01WpRpPSpNvMVdylQ+676l1toBHS3b+XY6knzWj+tYhfgTznrQlWSuf 1aPKzrvxj04ep0APK8jfV5k5NWkAFdXrBFph5hhyk3QAuuuToa8k4AR9ZEM2pu1SzMGH 5HrtcUWO3m5BrmYzVgFIIZbRoQENYj6gkUZpoqkrpGXpFHagMmU5PAkH/HypHw2KBF7+ QjBa4558gr0oN2CukmfcilZelqp1nMnKL40aVvNkBa8fnQ7iiZsm+jsk3jIS4CUdRXho UaLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si4353671ejs.321.2021.01.15.04.17.24; Fri, 15 Jan 2021 04:17:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729700AbhAOMPE (ORCPT + 99 others); Fri, 15 Jan 2021 07:15:04 -0500 Received: from foss.arm.com ([217.140.110.172]:37556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727550AbhAOMPD (ORCPT ); Fri, 15 Jan 2021 07:15:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97496139F; Fri, 15 Jan 2021 04:14:17 -0800 (PST) Received: from usa.arm.com (a074945.blr.arm.com [10.162.16.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1C3083F70D; Fri, 15 Jan 2021 04:14:12 -0800 (PST) From: Vivek Gautam To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org Cc: joro@8bytes.org, will.deacon@arm.com, mst@redhat.com, robin.murphy@arm.com, jean-philippe@linaro.org, eric.auger@redhat.com, alex.williamson@redhat.com, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, lorenzo.pieralisi@arm.com, shameerali.kolothum.thodi@huawei.com, vivek.gautam@arm.com Subject: [PATCH RFC v1 05/15] iommu/arm-smmu-v3: Set sync op from consumer driver of cd-lib Date: Fri, 15 Jan 2021 17:43:32 +0530 Message-Id: <20210115121342.15093-6-vivek.gautam@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115121342.15093-1-vivek.gautam@arm.com> References: <20210115121342.15093-1-vivek.gautam@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Te change allows different consumers of arm-smmu-v3-cd-lib to set their respective sync op for pasid entries. Signed-off-by: Vivek Gautam Cc: Joerg Roedel Cc: Will Deacon Cc: Robin Murphy Cc: Jean-Philippe Brucker Cc: Eric Auger Cc: Alex Williamson Cc: Kevin Tian Cc: Jacob Pan Cc: Liu Yi L Cc: Lorenzo Pieralisi Cc: Shameerali Kolothum Thodi --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c | 1 - drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c index ec37476c8d09..acaa09acecdd 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c @@ -265,7 +265,6 @@ struct iommu_vendor_psdtable_ops arm_cd_table_ops = { .free = arm_smmu_free_cd_tables, .prepare = arm_smmu_prepare_cd, .write = arm_smmu_write_ctx_desc, - .sync = arm_smmu_sync_cd, }; struct iommu_pasid_table *arm_smmu_register_cd_table(struct device *dev, 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 2f86c6ac42b6..0c644be22b4b 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1869,6 +1869,13 @@ static int arm_smmu_domain_finalise_s1(struct arm_smmu_domain *smmu_domain, if (ret) goto out_free_cd_tables; + /* + * Strange to setup an op here? + * cd-lib is the actual user of sync op, and therefore the platform + * drivers should assign this sync/maintenance ops as per need. + */ + tbl->ops->sync = arm_smmu_sync_cd; + /* * Note that this will end up calling arm_smmu_sync_cd() before * the master has been added to the devices list for this domain. -- 2.17.1