From 894c1697ab5771cc245fe3f70e51ccb2eca70bfd Mon Sep 17 00:00:00 2001 From: Janghyuck Kim Date: Wed, 1 Feb 2017 17:24:20 +0900 Subject: [PATCH] [COMMON] iommu/exynos: display sysmmu name when fault occurred In case of sysmmu page fault, it was difficult to distinguish the owner of invalid request. This patch displays sysmmu name to improve readability. Change-Id: I2a11a503c4ad64eaa819e8f76640c3dffc999d00 Signed-off-by: Janghyuck Kim --- drivers/iommu/exynos-iommu.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 7a20cc63ad5b..87fb55682b55 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -310,15 +310,19 @@ static void show_secure_fault_information(struct sysmmu_drvdata *drvdata, phys_addr_t pgtable; int fault_id = SYSMMU_FAULT_ID(flags); unsigned int sfrbase = drvdata->securebase; + const char *port_name = NULL; pgtable = __secure_info_read(sfrbase + REG_PT_BASE_PPN); pgtable <<= PAGE_SHIFT; info = __secure_info_read(sfrbase + REG_FAULT_TRANS_INFO); + of_property_read_string(drvdata->sysmmu->of_node, + "port-name", &port_name); + pr_crit("----------------------------------------------------------\n"); - pr_crit("%s %s %s at %#010lx (page table @ %pa)\n", - dev_name(drvdata->sysmmu), + pr_crit("From [%s], SysMMU %s %s at %#010lx (page table @ %pa)\n", + port_name ? port_name : dev_name(drvdata->sysmmu), (flags & IOMMU_FAULT_WRITE) ? "WRITE" : "READ", sysmmu_fault_name[fault_id], fault_addr, &pgtable); @@ -367,6 +371,7 @@ static void show_fault_information(struct sysmmu_drvdata *drvdata, unsigned int info; phys_addr_t pgtable; int fault_id = SYSMMU_FAULT_ID(flags); + const char *port_name = NULL; pgtable = __raw_readl(drvdata->sfrbase + REG_PT_BASE_PPN); pgtable <<= PAGE_SHIFT; @@ -380,9 +385,12 @@ static void show_fault_information(struct sysmmu_drvdata *drvdata, REG_FAULT_AW_TRANS_INFO : REG_FAULT_AR_TRANS_INFO)); } + of_property_read_string(drvdata->sysmmu->of_node, + "port-name", &port_name); + pr_crit("----------------------------------------------------------\n"); - pr_crit("%s %s %s at %#010lx (page table @ %pa)\n", - dev_name(drvdata->sysmmu), + pr_crit("From [%s], SysMMU %s %s at %#010lx (page table @ %pa)\n", + port_name ? port_name : dev_name(drvdata->sysmmu), (flags & IOMMU_FAULT_WRITE) ? "WRITE" : "READ", sysmmu_fault_name[fault_id], fault_addr, &pgtable); -- 2.20.1