Skip to content

Commit

Permalink
amd-iommu: detach device explicitly before attaching it to a new domain
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Jun 9, 2009
1 parent 2915007 commit 71ff3bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 71ff3bc

Please sign in to comment.