aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2009-05-21 03:56:58 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 12:06:54 -0400
commitc1eee67b2d8464781f5868a34168df61e40e85a6 (patch)
tree1be2221e6a157c59f6f8f01a9e01336cfc28ba50 /arch
parent0bc252f430d6a3ac7836d40f00d0ae020593b11b (diff)
amd iommu: properly detach from protection domain on ->remove
Some drivers may use the dma api during ->remove which will cause a protection domain to get reattached to a device. Delay the detach until after the driver is completely unbound. [ joro: added a little merge helper ] [ Impact: fix too early device<->domain removal ] Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/amd_iommu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index a97db99dad52..d6898833c363 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -57,6 +57,10 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
57static struct dma_ops_domain *find_protection_domain(u16 devid); 57static struct dma_ops_domain *find_protection_domain(u16 devid);
58 58
59 59
60#ifndef BUS_NOTIFY_UNBOUND_DRIVER
61#define BUS_NOTIFY_UNBOUND_DRIVER 0x0005
62#endif
63
60#ifdef CONFIG_AMD_IOMMU_STATS 64#ifdef CONFIG_AMD_IOMMU_STATS
61 65
62/* 66/*
@@ -1012,7 +1016,7 @@ static int device_change_notifier(struct notifier_block *nb,
1012 printk(KERN_INFO "AMD IOMMU: Using protection domain %d for " 1016 printk(KERN_INFO "AMD IOMMU: Using protection domain %d for "
1013 "device %s\n", dma_domain->domain.id, dev_name(dev)); 1017 "device %s\n", dma_domain->domain.id, dev_name(dev));
1014 break; 1018 break;
1015 case BUS_NOTIFY_UNBIND_DRIVER: 1019 case BUS_NOTIFY_UNBOUND_DRIVER:
1016 if (!domain) 1020 if (!domain)
1017 goto out; 1021 goto out;
1018 detach_device(domain, devid); 1022 detach_device(domain, devid);