From: Janghyuck Kim Date: Thu, 8 Dec 2016 02:23:31 +0000 (+0900) Subject: [COMMON] iommu/exynos: implement API to show status X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b99d971ecfb521f44e1c8bdbc70d89eaa5789b8e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] iommu/exynos: implement API to show status exynos_sysmmu_show_status() provides information of sysmmu status. Change-Id: Ia448f085acd3b7d605941481f7799899940420f3 Signed-off-by: Janghyuck Kim --- diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index b4cabf54492b..230d2a9630cd 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1547,10 +1547,37 @@ static struct iommu_ops exynos_iommu_ops = { .of_xlate = exynos_iommu_of_xlate, }; -void exynos_sysmmu_show_status(struct device *dev) +void exynos_sysmmu_show_status(struct device *master) { - /* DUMMY */ - dev_info(dev, "Called sysmmu show status\n"); + struct exynos_iommu_owner *owner; + struct sysmmu_list_data *list; + + if (!has_sysmmu(master)) { + dev_err(master, "has no sysmmu!\n"); + return; + } + + owner = master->archdata.iommu; + list_for_each_entry(list, &owner->sysmmu_list, node) { + unsigned long flags; + struct sysmmu_drvdata *drvdata; + + drvdata = dev_get_drvdata(list->sysmmu); + + spin_lock_irqsave(&drvdata->lock, flags); + if (!is_sysmmu_active(drvdata) || + !is_sysmmu_runtime_active(drvdata)) { + dev_info(drvdata->sysmmu, + "%s: SysMMU is not active\n", __func__); + spin_unlock_irqrestore(&drvdata->lock, flags); + continue; + } + + dev_info(drvdata->sysmmu, "Dumping status.\n"); + dump_sysmmu_status(drvdata->sfrbase); + + spin_unlock_irqrestore(&drvdata->lock, flags); + } } static int sysmmu_fault_notifier(struct notifier_block *nb,