Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1319418ybi; Fri, 24 May 2019 22:52:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxv+YN/j94CxYe2SoXZxZdQ/ZNLkN8YUm/bFiJ4OPBBhHLS3R1Rol2tbV9IaYHyJSMT4kDU X-Received: by 2002:a17:902:9347:: with SMTP id g7mr2974602plp.288.1558763532391; Fri, 24 May 2019 22:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558763532; cv=none; d=google.com; s=arc-20160816; b=eu+RK1kaKQbKl+Y+5Gb5wzBh1YTY0mdT8N5bYXTHjznXD0K5eR8IMJJw8+qPIgiydg fW75R9egFYo/cKPEjDoqL9/e8l+qicpw7zuLdd2khOl8jBMmG8qjz9GevHaYO2Of8B+T /ocrfOClIaCkCnQpi6PEjjwvq5ydnyg/WFA9syOyvxVpkkcNMiD4tpE1m1NezEsJ5cz1 HoQZ8ZwAnXGJxqjp420CNt9qnvv5M49kHnAw3wPLY31raxfcc0mO9neUPUen5EhWcuzi 0HUuWW8wEm7cd/NvH2OxMPzmJOBwjDZxCAFOn6MBJl6scGIyJe5ZFgnywNUIkLtfSIyS x+zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=yPYc70R2chmIWMx2glfbN9qH8Hk0DRvdtxvD5vnZMcg=; b=tUH7D3awVDW05v6kFcIeFeGKfXpdKxpwlekyOGR3kx+kuMiu/TyD6pdaH3QmrHm2Qd r/F5jvfYbCAipWJXthc2GcDtUGGP5R+3c1TCGA+Gx/65Exm1FH8gJev8OfolJBMVN0wK dDy5w70v2E9iaEXww2lnkwAZUZQgiXCYhmz6PzcB98BIj3UGEtp9FYnep1GZotMlfcC7 NkShIhvk4D4/uI2AMkcLeo4FyvbWGKC6sW3xOoS+5/CzptxwavuwyL9kv1PnLfg7eUPx DxR5T4EagrmF575yPSSgZXJLIA2trt5+qBeYSdwAhsTiO5SnbPFjs7VAUwAztzZQYzGH Xn0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e127si6978121pgc.214.2019.05.24.22.51.57; Fri, 24 May 2019 22:52:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbfEYFtR (ORCPT + 99 others); Sat, 25 May 2019 01:49:17 -0400 Received: from mga05.intel.com ([192.55.52.43]:46780 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfEYFtP (ORCPT ); Sat, 25 May 2019 01:49:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 May 2019 22:49:14 -0700 X-ExtLoop1: 1 Received: from allen-box.sh.intel.com ([10.239.159.136]) by fmsmga006.fm.intel.com with ESMTP; 24 May 2019 22:49:12 -0700 From: Lu Baolu To: David Woodhouse , Joerg Roedel Cc: ashok.raj@intel.com, jacob.jun.pan@intel.com, kevin.tian@intel.com, jamessewart@arista.com, tmurphy@arista.com, dima@arista.com, sai.praneeth.prakhya@intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v4 14/15] iommu/vt-d: Remove duplicated code for device hotplug Date: Sat, 25 May 2019 13:41:35 +0800 Message-Id: <20190525054136.27810-15-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190525054136.27810-1-baolu.lu@linux.intel.com> References: <20190525054136.27810-1-baolu.lu@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The iommu generic code has handled the device hotplug cases. Remove the duplicated code. Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index ba425db8cfc6..7c7230ae6967 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -4568,39 +4568,6 @@ int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) return 0; } -/* - * Here we only respond to action of unbound device from driver. - * - * Added device is not attached to its DMAR domain here yet. That will happen - * when mapping the device to iova. - */ -static int device_notifier(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct device *dev = data; - struct dmar_domain *domain; - - if (iommu_dummy(dev)) - return 0; - - if (action == BUS_NOTIFY_REMOVED_DEVICE) { - domain = find_domain(dev); - if (!domain) - return 0; - - dmar_remove_one_dev_info(dev); - } else if (action == BUS_NOTIFY_ADD_DEVICE) { - if (iommu_should_identity_map(dev)) - domain_add_dev_info(si_domain, dev); - } - - return 0; -} - -static struct notifier_block device_nb = { - .notifier_call = device_notifier, -}; - static int intel_iommu_memory_notifier(struct notifier_block *nb, unsigned long val, void *v) { @@ -4975,7 +4942,6 @@ int __init intel_iommu_init(void) } bus_set_iommu(&pci_bus_type, &intel_iommu_ops); - bus_register_notifier(&pci_bus_type, &device_nb); if (si_domain && !hw_pass_through) register_memory_notifier(&intel_iommu_memory_nb); cpuhp_setup_state(CPUHP_IOMMU_INTEL_DEAD, "iommu/intel:dead", NULL, -- 2.17.1