diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-06-08 22:47:33 +0200 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-06-09 11:14:14 +0200 |
commit | 71ff3bca2f70264effe8cbbdd5bc10cf6be5f2f0 (patch) | |
tree | 0930054b71a0d674d71ea05d7575e4a7efac7bf3 | |
parent | amd-iommu: remove BUS_NOTIFY_BOUND_DRIVER handling (diff) | |
download | linux-71ff3bca2f70264effe8cbbdd5bc10cf6be5f2f0.tar.xz linux-71ff3bca2f70264effe8cbbdd5bc10cf6be5f2f0.zip |
amd-iommu: detach device explicitly before attaching it to a new domain
This fixes a bug with a device that could not be assigned to a KVM guest
because it is still assigned to a dma_ops protection domain.
[chrisw: simply remove WARN_ON(), will always fire since dev->driver
will be pci-sub]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 81872604eb76..772e91088e40 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -2073,7 +2073,7 @@ static int amd_iommu_attach_device(struct iommu_domain *dom, old_domain = domain_for_device(devid); if (old_domain) - return -EBUSY; + detach_device(old_domain, devid); attach_device(iommu, domain, devid); |