From nobody Tue Sep 16 10:49:27 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85B65C4332F for ; Wed, 4 Jan 2023 13:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235002AbjADNHJ (ORCPT ); Wed, 4 Jan 2023 08:07:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239303AbjADNGu (ORCPT ); Wed, 4 Jan 2023 08:06:50 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA7A61E3F7 for ; Wed, 4 Jan 2023 05:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672837594; x=1704373594; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W4kgWJ13KkfOnFNvqJ626ui344bVCUNFAhn6AsaS62k=; b=QGhIfr59Z4JHsKb9iSPsKMKvWoStPG80Ok0uApMWd29pRD2lTN93muVt 1QqJJEgC7ZU+eaGKkeLsP5JA/DGZssim5v52MTpHRV9ubS9Rb/BYS9sJ0 hoMdZYkPp8T8KenP4osrmXpKv6C6+kpUHux0bAQ4BtWsRSpxWbyMnpn6V PX+JPzJBhtF79NXFkC/X5w9ngdIV1xkMJOcJtY6r1CwHUIA5hV+vJS6fz To7D6Mlkex2bYXtZdu8AvfG6WhwSicRYlF3mlWMkxTM2yyQqWIBCkUNjI qvUtzcP7UbtWE9cPv6tofJbILUftqn1LSWw31/cydGXEQeJNk4h2+8bJ3 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="320639997" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="320639997" 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:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="797529117" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="797529117" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 04 Jan 2023 05:06:27 -0800 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Suravee Suthikulpanit , Hector Martin , Sven Peter , Rob Clark , Marek Szyprowski , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Yong Wu , Matthias Brugger , Heiko Stuebner , Matthew Rosato , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Thierry Reding , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v4 11/19] iommu/fsl_pamu: Add set_platform_dma_ops callback Date: Wed, 4 Jan 2023 20:57:17 +0800 Message-Id: <20230104125725.271850-12-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jason Gunthorpe --- drivers/iommu/fsl_pamu_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domai= n.c index 4408ac3c49b6..e123161c211a 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -283,9 +283,9 @@ static int fsl_pamu_attach_device(struct iommu_domain *= domain, return ret; } =20 -static void fsl_pamu_detach_device(struct iommu_domain *domain, - struct device *dev) +static void fsl_pamu_set_platform_dma(struct device *dev) { + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); struct fsl_dma_domain *dma_domain =3D to_fsl_dma_domain(domain); const u32 *prop; int len; @@ -452,9 +452,9 @@ static const struct iommu_ops fsl_pamu_ops =3D { .domain_alloc =3D fsl_pamu_domain_alloc, .probe_device =3D fsl_pamu_probe_device, .device_group =3D fsl_pamu_device_group, + .set_platform_dma_ops =3D fsl_pamu_set_platform_dma; .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D fsl_pamu_attach_device, - .detach_dev =3D fsl_pamu_detach_device, .iova_to_phys =3D fsl_pamu_iova_to_phys, .free =3D fsl_pamu_domain_free, } --=20 2.34.1