From nobody Fri Sep 19 07:19:25 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 CA5EEC433FE for ; Mon, 28 Nov 2022 06:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbiK1G45 (ORCPT ); Mon, 28 Nov 2022 01:56:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiK1G4Q (ORCPT ); Mon, 28 Nov 2022 01:56:16 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAECE1572B for ; Sun, 27 Nov 2022 22:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618565; x=1701154565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2uZWB31+7BHbXDhpDwxdAHkoChULgPE00ii//Ntnb2A=; b=FWuIz94duB0Lv0Hi9yCaWVq/VwoJQxjJ7YSUzk7x48eLgTAMkKANyaGu ApCKC9kdHbMyJ3SyS95qnxlijeIQN02CziESzPggKtOFlsCmkC4Ej2XLX KpXRBo3jLae5nKzYhci7PDB3elz0T4ikbq3oiAtu4nAiWHHfO476Ck1QP MD9Fc8hyLl/5jfvESixVVJHlv2an/SO7NT+9NjZe/nQz/TJNoWJGRsDYd +fFKIzzTtzBWnGkW5pNAnek86Rn9iVGsCSXPvfli/e5tDAgELlHgcIJ5b 1/9bVwc/CnCVODDL7f4qoD0L5h1q+8vReZpvhGsI/9c7cvMlOJL8+AX2Z A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="312395267" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="312395267" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121278" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121278" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:58 -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 17/20] iommu/tegra: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:45 +0800 Message-Id: <20221128064648.1934720-18-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-smmu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 5b1af40221ec..a36e163e5cc1 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -527,6 +527,14 @@ static void tegra_smmu_detach_dev(struct iommu_domain = *domain, struct device *de } } =20 +static void tegra_smmu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain =3D iommu_get_domain_for_dev(dev); + + if (domain) + tegra_smmu_detach_dev(domain, dev); +} + static void tegra_smmu_set_pde(struct tegra_smmu_as *as, unsigned long iov= a, u32 value) { @@ -965,6 +973,7 @@ static const struct iommu_ops tegra_smmu_ops =3D { .domain_alloc =3D tegra_smmu_domain_alloc, .probe_device =3D tegra_smmu_probe_device, .device_group =3D tegra_smmu_device_group, + .set_platform_dma =3D tegra_smmu_set_platform_dma, .of_xlate =3D tegra_smmu_of_xlate, .pgsize_bitmap =3D SZ_4K, .default_domain_ops =3D &(const struct iommu_domain_ops) { --=20 2.34.1