diff options
author | Simon <xxm@rock-chips.com> | 2016-03-25 16:31:37 +0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@rock-chips.com> | 2016-03-28 10:42:59 +0800 |
commit | d8e3c63e3054ce6b7994f38d010567d235024724 (patch) | |
tree | 722530ac7dc04369baa69faa65a60d743ffef7cd /drivers/iommu/rockchip-iommu.c | |
parent | 95ed49abd66cbacf845403bcffa9ac6eeb89e417 (diff) |
iommu/rockchip: add more judgement for virtual device who using iommu
A virtual device like "drm" call iommu_attach_device may fail.
Current only judge if a device has "group", this is not enough,
"group->iommu_data" is needed
Change-Id: I1a66d6016dfef867d83aa4cccaf223ced4e07161
Signed-off-by: Simon <xxm@rock-chips.com>
Diffstat (limited to 'drivers/iommu/rockchip-iommu.c')
-rw-r--r-- | drivers/iommu/rockchip-iommu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 044c5685b115..e9db6badd5cb 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -772,6 +772,11 @@ static struct rk_iommu *rk_iommu_from_dev(struct device *dev) if (!group) return NULL; iommu_dev = iommu_group_get_iommudata(group); + if (!iommu_dev) { + dev_info(dev, "Possibly a virtual device\n"); + return NULL; + } + rk_iommu = dev_get_drvdata(iommu_dev); iommu_group_put(group); |