From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAC59631 for ; Mon, 28 Nov 2022 06:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618573; x=1701154573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r5xbh896pHOm4nF0J2WHqkUdwYnD0sIQJbuduyaVUB4=; b=Om73+VA5QdJRWNBTLDm/i4vKIWWYNrFBFnY6V2NttEeaqOmmg8nApRhG hp/0d/pBsVKqiI7a5ppNUiWNFvD1oDT9RB10icF7DNHFeqRVsRunKQdYY aQvR9OR45Qo2v28R3q/2kYCWdH1Phh7dQfjkJyBaOy590v5w1iLNp/tQ7 5MpL23mKt8OySZNtzOTCwD31xbINjfutExRMilhpf6qD0wlyYSvDeAHdQ oSB2VWHhGBSVp/LYMRN1+LR78uobapay+ZR3GP0A+1j39ASvtju8XCUhd kZTnM84cGDHFTXJf3EfwkaIkAC1gXRXd5T6N/XZ3Ggz5fpthdc2A+oqTJ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="379016404" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="379016404" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.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> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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); } +static void gart_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = 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 = { .domain_alloc = gart_iommu_domain_alloc, .probe_device = gart_iommu_probe_device, .device_group = generic_device_group, + .set_platform_dma = gart_iommu_set_platform_dma, .pgsize_bitmap = GART_IOMMU_PGSIZES, .of_xlate = gart_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { -- 2.34.1