提交 71ff3bca 编写于 作者: J Joerg Roedel

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: NChris Wright <chrisw@sous-sol.org>
Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
上级 29150078
...@@ -2073,7 +2073,7 @@ static int amd_iommu_attach_device(struct iommu_domain *dom, ...@@ -2073,7 +2073,7 @@ static int amd_iommu_attach_device(struct iommu_domain *dom,
old_domain = domain_for_device(devid); old_domain = domain_for_device(devid);
if (old_domain) if (old_domain)
return -EBUSY; detach_device(old_domain, devid);
attach_device(iommu, domain, devid); attach_device(iommu, domain, devid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册