From nobody Fri Sep 19 07:17: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 5416EC433FE for ; Mon, 28 Nov 2022 06:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbiK1GyS (ORCPT ); Mon, 28 Nov 2022 01:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiK1GyQ (ORCPT ); Mon, 28 Nov 2022 01:54:16 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97024140F2 for ; Sun, 27 Nov 2022 22:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618454; x=1701154454; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z+afdRodACErnoYidPGbh7hMpmtegQAHzVqp7Lq5B/A=; b=PEVxGswz8WYVMfM1oFkC6rOxs1Mml/s7QXR9/d6Ai0KvG0Lw8NcKVX4p T9YObTNeWFmAHRa9nVZMzbk1GPH5Vgs9urtufb5Mp441YhyEzcA0t6Lq8 JwJoUNBCkEHooiz3HSFIe4JwQOcy3NH/+GLBW0G1yX64qQ5/AAkeod/p9 /WELCPcaZaFXgZGcSYE0pqViBPvgKl+oExFuyWdgT3irTY+P062s0qjEC 3AF9zEIfgfxblb+cnqHNkf+gUwWFrOprOkJn5UGnKeLTR39k/xzRYKHSL ZLfRCTWw/NTgcBdTtDbxn5UijTQccEf/DmDguWcX/FdXKKcjnhN3rH5zp w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="341672029" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="341672029" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120646" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120646" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:07 -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 01/20] iommu/amd: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:29 +0800 Message-Id: <20221128064648.1934720-2-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" The AMD IOMMU supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/amd/iommu.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 5c381cc3658e..bd1970b4f48b 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2126,31 +2126,6 @@ static void amd_iommu_domain_free(struct iommu_domai= n *dom) protection_domain_free(domain); } =20 -static void amd_iommu_detach_device(struct iommu_domain *dom, - struct device *dev) -{ - struct iommu_dev_data *dev_data =3D dev_iommu_priv_get(dev); - struct amd_iommu *iommu; - - if (!check_device(dev)) - return; - - if (dev_data->domain !=3D NULL) - detach_device(dev); - - iommu =3D rlookup_amd_iommu(dev); - if (!iommu) - return; - -#ifdef CONFIG_IRQ_REMAP - if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) && - (dom->type =3D=3D IOMMU_DOMAIN_UNMANAGED)) - dev_data->use_vapic =3D 0; -#endif - - iommu_completion_wait(iommu); -} - static int amd_iommu_attach_device(struct iommu_domain *dom, struct device *dev) { @@ -2414,7 +2389,6 @@ const struct iommu_ops amd_iommu_ops =3D { .def_domain_type =3D amd_iommu_def_domain_type, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D amd_iommu_attach_device, - .detach_dev =3D amd_iommu_detach_device, .map_pages =3D amd_iommu_map_pages, .unmap_pages =3D amd_iommu_unmap_pages, .iotlb_sync_map =3D amd_iommu_iotlb_sync_map, --=20 2.34.1