Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13218700rwl; Wed, 4 Jan 2023 05:19:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXvUaOk/rzQK/jJSYgVwTBaI68NHxJajDPQ/FeRf7V5MAQxg/HG8yyRK7zRAgKsALGJ313uK X-Received: by 2002:a17:906:1e17:b0:84c:69f8:2ec2 with SMTP id g23-20020a1709061e1700b0084c69f82ec2mr24453844ejj.22.1672838395481; Wed, 04 Jan 2023 05:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672838395; cv=none; d=google.com; s=arc-20160816; b=x5Ruj0qhbs3XoTHhMDxlsgljpxRvdubuP4nv7hJO+cFS3GPa24tdD0InK9dwOQl6Z7 UOfPH2sWZeKiFWRaqInYa0C8yZpGIpSgR3o+6l/TGIpvYU4Xmx6KPkvJo64FHBkenVLW Bf6sfb4rvT9n3u3dAXIeVZT4+sRp/YgUYBIqte2l0Oz24GVGo4MsiZ1zskDkN8aX61T3 81STgAjnt4TrrrIdjVo/mAKFuQuzmpowXhFIAkc/Cur30YGoMhRGMF4r+YPp3MXBS8bI 80DDNb4c9Ldk4T3eQtMPmCbsL4U2L5lngG5ibJ/DgfFQZFWzl9veU8HCSde44xee6prl jBOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c/qS03n8RBIn2zv8wsW+7KossYf0rzkY0Qexyyn4GYw=; b=GCpb7OpVaeCX4jtMo2qkwqj+Bd43QEUmcwUXHrmZceppHva6N10my8bgu9bRwEQq4x M7BGQzhNIzERQbfUmhEbWwZFiAiTQj0E98ncLWE9wCbjZXJN2tvF+K6H5zWcRGeOSK3a LaKLkxm05PHIAK5WxSaW0y0dtPMgEd+OCEbqRbZ66IGA933nyRZ7Gh8V1mvvaX1h8YBp R2D/kMRhXKVMtpqOtODX01UcfKy1LBshZ3UIfoK0dnUAaZHqfGqqiMy+FwBvCBiWABBt 7UL1a+jFc1vR9/C7rDy/IrD5T5LizTpPZ3VQodwUlPbN7ut+KYuz4SRlZ7YjI8PhHBjA E0gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XqGsS7ds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wv1-20020a170907080100b007a2d966eeccsi28162608ejb.686.2023.01.04.05.19.42; Wed, 04 Jan 2023 05:19:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XqGsS7ds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239319AbjADNFo (ORCPT + 57 others); Wed, 4 Jan 2023 08:05:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbjADNF3 (ORCPT ); Wed, 4 Jan 2023 08:05:29 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EABBF1DF3A for ; Wed, 4 Jan 2023 05:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672837528; x=1704373528; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1xeeuRQM/dsTN33VxOfF8H61kIE4esUx5TqB4kEEMhw=; b=XqGsS7dsKWlMyoia0AexbFZUCD63G7c/xjHFwI/q/m40dXAh37l0rJTw tkWgpEcQZzdXZXlUWzFOq7TF4iRigPSwKk96AuD6DbImLgurITnQrAueI lS1cIbgAhkBI8tfOLG/+kH2lAQra9sxt5x0l+X2nRxHLoY/sfrXwI9Ndi t43vt3q3jKYrG7OWEogIz55ljbQ46eKrGb+kaKTGkKu4146ng6ux8C9+h 7eOtP0gHYcIGpMJDIWucWjHVcWKjSOa+FEyT1wC1AY+Q5Q0SpTU6rWB2D SIfZ3Cklu+5+BNYEb59GXfn/bK+4bV5s1YWE/EygzRrh740Dhj3f27yXV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="320639595" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="320639595" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 05:05:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="797529016" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="797529016" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 04 Jan 2023 05:05:21 -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 v4 01/19] iommu/amd: Remove detach_dev callback Date: Wed, 4 Jan 2023 20:57:07 +0800 Message-Id: <20230104125725.271850-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230104125725.271850-1-baolu.lu@linux.intel.com> References: <20230104125725.271850-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AMD IOMMU supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Reviewed-by: Jason Gunthorpe Signed-off-by: Lu Baolu --- 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 cbeaab55c0db..92319c9b877c 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_domain *dom) protection_domain_free(domain); } -static void amd_iommu_detach_device(struct iommu_domain *dom, - struct device *dev) -{ - struct iommu_dev_data *dev_data = dev_iommu_priv_get(dev); - struct amd_iommu *iommu; - - if (!check_device(dev)) - return; - - if (dev_data->domain != NULL) - detach_device(dev); - - iommu = rlookup_amd_iommu(dev); - if (!iommu) - return; - -#ifdef CONFIG_IRQ_REMAP - if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) && - (dom->type == IOMMU_DOMAIN_UNMANAGED)) - dev_data->use_vapic = 0; -#endif - - iommu_completion_wait(iommu); -} - static int amd_iommu_attach_device(struct iommu_domain *dom, struct device *dev) { @@ -2416,7 +2391,6 @@ const struct iommu_ops amd_iommu_ops = { .def_domain_type = amd_iommu_def_domain_type, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = amd_iommu_attach_device, - .detach_dev = amd_iommu_detach_device, .map_pages = amd_iommu_map_pages, .unmap_pages = amd_iommu_unmap_pages, .iotlb_sync_map = amd_iommu_iotlb_sync_map, -- 2.34.1