From nobody Fri Sep 19 07:18:43 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 9BD41C4321E for ; Mon, 28 Nov 2022 06:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiK1G4x (ORCPT ); Mon, 28 Nov 2022 01:56:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbiK1G4L (ORCPT ); Mon, 28 Nov 2022 01:56:11 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 687F114D0E for ; Sun, 27 Nov 2022 22:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618558; x=1701154558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r5xbh896pHOm4nF0J2WHqkUdwYnD0sIQJbuduyaVUB4=; b=MQvKTmw4fi1bVD4F0Llp7FCeAuuyMKDHlH6zbPIssTfPjNgCvsbiHb5q +468s1Wly9RIstmGULcNN0Ta9XFsdD8S9ZVUTQPu0eisJRYrHFhUK2MgR wSDOqwT7XqzF/K9C970FyEzveGoH67Wsch9ayqF3tu+RwOoRcIWWcuHUt MAMoVWeFMYskCv8ueJSddEx8cd0HvvEmT95x4/tjFSHl8t3TZcCd+7KT2 3NfckKSb5pseNQsLeHw4P5QPQWDyMXIQf2M7Jwak9EKKedFt5ZOYkIq8E wG039RIf4JZNvA4+Uk3OhlJmxHeYrb645BofIb4deYNwxII1pOzAokTH6 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="294462659" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="294462659" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121259" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121259" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:51 -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 v3 16/20] iommu/gart: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:44 +0800 Message-Id: <20221128064648.1934720-17-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-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 callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/tegra-gart.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index ed53279d1106..f56e40b5c47a 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -141,6 +141,14 @@ static void gart_iommu_detach_dev(struct iommu_domain = *domain, spin_unlock(&gart->dom_lock); } =20 +static void gart_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + if (domain) + gart_iommu_detach_dev(domain, dev); +} + static struct iommu_domain *gart_iommu_domain_alloc(unsigned type) { struct iommu_domain *domain; @@ -270,6 +278,7 @@ static const struct iommu_ops gart_iommu_ops =3D { .domain_alloc =3D gart_iommu_domain_alloc, .probe_device =3D gart_iommu_probe_device, .device_group =3D generic_device_group, + .set_platform_dma =3D gart_iommu_set_platform_dma, .pgsize_bitmap =3D GART_IOMMU_PGSIZES, .of_xlate =3D gart_iommu_of_xlate, .default_domain_ops =3D &(const struct iommu_domain_ops) { --=20 2.34.1