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 C3B9D361 for ; Mon, 28 Nov 2022 06:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618481; x=1701154481; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eIhdB1b3IGDflIBfoIAJvdUglY1B9SKoTD7H5eODBXw=; b=mk4KMxTcGK37OlF9PXvjpWKaUHGQjEzfW+r9hgEeRMoIuMLFSrlRK5sC ZT4isFG14W1DisGUao9G4pqfXjLBxOeXNjH66cHESuX27ukx0uzIF1hwC 0/4dDgAWN6U7bZwY5Qtlr//5A0gugBoVRph7RfOJOpkMap1y0F3Sd5aEQ V5kK+9F9P3RZ8StcUXnNPGjvyx/7Y8LpiHxhPuYfCawTO9F9BECDqcT0e Wka7D035urO2hZ1TtG+5cTbXwRy5Hj/2B88ijconA9IcMpDENDiN0GgPG /D5piwhIGovxWcgZoQTsDoe/1oluyiY42ZMkI5HRBUhAN4uYDLSqrWg1v Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="379016128" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="379016128" 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:54:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120787" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120787" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:34 -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 05/20] iommu/ipmmu: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:33 +0800 Message-Id: <20221128064648.1934720-6-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 The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/ipmmu-vmsa.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index a003bd5fc65c..3112822ac7be 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -643,21 +643,6 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain, return 0; } -static void ipmmu_detach_device(struct iommu_domain *io_domain, - struct device *dev) -{ - struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain); - unsigned int i; - - for (i = 0; i < fwspec->num_ids; ++i) - ipmmu_utlb_disable(domain, fwspec->ids[i]); - - /* - * TODO: Optimize by disabling the context when no device is attached. - */ -} - static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -876,7 +861,6 @@ static const struct iommu_ops ipmmu_ops = { .of_xlate = ipmmu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = ipmmu_attach_device, - .detach_dev = ipmmu_detach_device, .map_pages = ipmmu_map, .unmap_pages = ipmmu_unmap, .flush_iotlb_all = ipmmu_flush_iotlb_all, -- 2.34.1