Message ID | 20230104125725.271850-13-baolu.lu@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5133978wrt; Wed, 4 Jan 2023 05:09:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMmQ/FESMGABamuy0ote66QqrDNyERCwIIchm02uQV20KC++euKm5I4WAgq7hDloP5H6IT X-Received: by 2002:a62:1c84:0:b0:576:e4c7:97bf with SMTP id c126-20020a621c84000000b00576e4c797bfmr47460720pfc.15.1672837753483; Wed, 04 Jan 2023 05:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672837753; cv=none; d=google.com; s=arc-20160816; b=xdy6+dIq5jXDooRvpJ4mdZozdHRZmYNKf+bZD3yuEvsw1dYH0B5f3yA9cfIPXl6YOg H9TlyOlbI3OiyncemAr9XyDDFjNoDu1GKVGFdejvprbhOd8/TZ3s9JtkiDqMu1iCEvWI cTE/kdy0a+IzsW19UARJRd8Hofe36G7nExI6oo1FNd3yRP93DhYpdntOqjuex6xFRN4a C5A30QFjztjjBbM73RBo8JNYOdjGI2sjpliQINjObKDcYCSDIt0QM0GzupxsyzSIGP3e ru16rNHjf7z0mu35npGtthEm3TPThq8ROp2doGWIo6hIjbhbomRaskLEKkZx/SI75EbL aVNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mRYBurpZZLOInoZl/2P5wqP1nXSyPihfY1U3ozGzByA=; b=OucQgC7ZTBFsdSC7p7jCnUyxbQAPg0JEjy+bFaZ+gY6sRk0y31iUGEOx541GXpLiP0 zEFY/WH0zYIk61cG2EDxl57f7O+Iqeg8Qa7mJ4IJ9f1WzqkFeelj22ubAYlV7d09Udu4 brvRuWlv+dCzZA10Litu5QueU+yF7xyxuI49yDkXa7hGbXwBdJo2LIHMBJB17u/juczx chKD94pfGihuzpjtKm0UFXVzLgECB42/XDDobHqGZO9lEYSRIsiEhVKG9mQ46LIa2Dae YhRbiHc9Zx2v108k+855B6Tt9tPRCDjNwMDlSzYzxRfi1jxlcKF4MYLUIlfPeQIReP67 kF1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LebyiJ4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j67-20020a625546000000b00577c17000e1si32130606pfb.280.2023.01.04.05.08.53; Wed, 04 Jan 2023 05:09:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LebyiJ4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239287AbjADNIV (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Wed, 4 Jan 2023 08:08:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239365AbjADNHs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Jan 2023 08:07:48 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8A83753F for <linux-kernel@vger.kernel.org>; Wed, 4 Jan 2023 05:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672837626; x=1704373626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Iko82bs3XyVMHXHooIhs56+RqC7yt7lL9TP+oKjcj1Y=; b=LebyiJ4GssdL5TrjQrihgBH9zENwrLGnK0uDMOj/bY3145bXx/pa+Ylv zCIZkc8D9O3n6uwKbix/r9XBKeBqBEEwZ+LBu3I6Q/0GRd4A/VQQMZZ0L HJlyi0e2p5ggBOT1fDPHwdOYA1SXQRocagofJdOfYQl134XOHBIWnV31x YG2seRLWtaWyN/3ghmokFe620plfJfPwlS8th8smPPQtcQTh4EOL/BZF5 GX4vSVqtI88l6kRFkY6ZI8zjzRIs+klK4jnZJmunV8xM04ADvHpHyIyV9 +YayqIYnIuGH05rcG+NffyzypzA5FeQ/Lfd1VoAHIrtL0tDXn843JcSKv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="320640061" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="320640061" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 05:06:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="797529125" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="797529125" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 04 Jan 2023 05:06:34 -0800 From: Lu Baolu <baolu.lu@linux.intel.com> To: Joerg Roedel <joro@8bytes.org>, Jason Gunthorpe <jgg@nvidia.com>, Christoph Hellwig <hch@infradead.org>, Kevin Tian <kevin.tian@intel.com>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Jean-Philippe Brucker <jean-philippe@linaro.org> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>, Rob Clark <robdclark@gmail.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Yong Wu <yong.wu@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, Heiko Stuebner <heiko@sntech.de>, Matthew Rosato <mjrosato@linux.ibm.com>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Thierry Reding <thierry.reding@gmail.com>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu <baolu.lu@linux.intel.com> Subject: [PATCH v4 12/19] iommu/msm: Add set_platform_dma_ops callback Date: Wed, 4 Jan 2023 20:57:18 +0800 Message-Id: <20230104125725.271850-13-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230104125725.271850-1-baolu.lu@linux.intel.com> References: <20230104125725.271850-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754097520291745976?= X-GMAIL-MSGID: =?utf-8?q?1754097520291745976?= |
Series |
iommu: Retire detach_dev callback
|
|
Commit Message
Baolu Lu
Jan. 4, 2023, 12:57 p.m. UTC
This IOMMU driver doesn't support default domain. Add the implementation
of set_platform_dma_ops callback so that the IOMMU core could return the
DMA control. With the set_platform_dma_ops implemented, there's no need
for detach_dev. Remove it to avoid dead code.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/msm_iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Wed, Jan 04, 2023 at 08:57:18PM +0800, Lu Baolu wrote: > This IOMMU driver doesn't support default domain. Add the implementation > of set_platform_dma_ops callback so that the IOMMU core could return the > DMA control. With the set_platform_dma_ops implemented, there's no need > for detach_dev. Remove it to avoid dead code. > > Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> > --- > drivers/iommu/msm_iommu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Jason
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index c60624910872..454f6331c889 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -443,9 +443,9 @@ static int msm_iommu_attach_dev(struct iommu_domain *domain, struct device *dev) return ret; } -static void msm_iommu_detach_dev(struct iommu_domain *domain, - struct device *dev) +static void msm_iommu_set_platform_dma(struct device *dev) { + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); struct msm_priv *priv = to_msm_priv(domain); unsigned long flags; struct msm_iommu_dev *iommu; @@ -678,11 +678,11 @@ static struct iommu_ops msm_iommu_ops = { .domain_alloc = msm_iommu_domain_alloc, .probe_device = msm_iommu_probe_device, .device_group = generic_device_group, + .set_platform_dma_ops = msm_iommu_set_platform_dma, .pgsize_bitmap = MSM_IOMMU_PGSIZES, .of_xlate = qcom_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = msm_iommu_attach_dev, - .detach_dev = msm_iommu_detach_dev, .map_pages = msm_iommu_map, .unmap_pages = msm_iommu_unmap, /*