Skip to content

Commit f899527

Browse files
Simon Xuerkhuangtao
authored andcommitted
iommu/rockchip: fix rockchip_iommu_is_enabled api
Fixes: 1876202 ("iommu/rockchip: add rockchip_iommu_is_enabled api") Change-Id: Ifdccd89e74bccc69c5e15abc835fba529287f92f Signed-off-by: Simon Xue <[email protected]>
1 parent 046d5df commit f899527

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/iommu/rockchip-iommu.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ struct rk_iommu {
144144
struct iommu_group *group;
145145
u32 version;
146146
bool shootdown_entire;
147+
bool iommu_enabled;
147148
};
148149

149150
struct rk_iommudata {
@@ -1306,6 +1307,8 @@ static void rk_iommu_disable(struct rk_iommu *iommu)
13061307
}
13071308
rk_iommu_disable_stall(iommu);
13081309
clk_bulk_disable(iommu->num_clocks, iommu->clocks);
1310+
1311+
iommu->iommu_enabled = false;
13091312
}
13101313

13111314
int rockchip_iommu_disable(struct device *dev)
@@ -1367,6 +1370,10 @@ static int rk_iommu_enable(struct rk_iommu *iommu)
13671370
rk_iommu_disable_stall(iommu);
13681371
out_disable_clocks:
13691372
clk_bulk_disable(iommu->num_clocks, iommu->clocks);
1373+
1374+
if (!ret)
1375+
iommu->iommu_enabled = true;
1376+
13701377
return ret;
13711378
}
13721379

@@ -1390,7 +1397,7 @@ bool rockchip_iommu_is_enabled(struct device *dev)
13901397
if (!iommu)
13911398
return false;
13921399

1393-
return rk_iommu_is_paging_enabled(iommu);
1400+
return iommu->iommu_enabled;
13941401
}
13951402
EXPORT_SYMBOL(rockchip_iommu_is_enabled);
13961403

0 commit comments

Comments
 (0)