iommu: hack for disable rockchip iommu

Get iommu_ops from platform bus of dev if domain is NULL to avoid
kernel crash

Change-Id: I5554b06a450805fb3812f1ade60f335efa4d2a4e
Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
Simon Xue
2019-07-10 12:02:39 +08:00
committed by Tao Huang
parent 5e8e93eccb
commit 4262c9fb63

View File

@@ -1321,6 +1321,13 @@ static int __iommu_attach_device(struct iommu_domain *domain,
struct device *dev)
{
int ret;
/* Hack for disable iommu */
if (!domain) {
ret = dev->bus->iommu_ops->attach_dev(domain, dev);
return ret;
}
if ((domain->ops->is_attach_deferred != NULL) &&
domain->ops->is_attach_deferred(domain, dev))
return 0;