[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091002211826.GA11326@linux-os.sc.intel.com>
Date: Fri, 2 Oct 2009 14:18:27 -0700
From: Fenghua Yu <fenghua.yu@...el.com>
To: David Woodhouse <dwmw2@...radead.org>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Francois Isabelle <Francois.Isabelle@...kontron.com>
Cc: Weidong Han <weidong.han@...el.com>,
iommu@...ts.linux-foundation.org,
Grant Grundler <grundler@...isc-linux.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] intel-iommu: PCIe hot plug for Intel iommu - IOMMU API
We expand existing IOMMU API iommu_detach_device for PCIe hot remove. We don't
need IOMMU API for hot add.
Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
---
drivers/pci/intel-iommu.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 855dd7c..5c12283 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -3559,9 +3559,20 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
static void intel_iommu_detach_device(struct iommu_domain *domain,
struct device *dev)
{
- struct dmar_domain *dmar_domain = domain->priv;
+ struct dmar_domain *dmar_domain;
struct pci_dev *pdev = to_pci_dev(dev);
+ /* If domain=NULL, we'll find a valid domain for the device.*/
+ if (!domain) {
+ dmar_domain = find_domain(pdev);
+ if (!dmar_domain) {
+ printk(KERN_ERR "Can not find IOMMU domain for %s\n",
+ pci_name(pdev));
+ return;
+ }
+ } else
+ dmar_domain = domain->priv;
+
domain_remove_one_dev_info(dmar_domain, pdev);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists