Commit 0bf4e54d authored by Cho KyongHo's avatar Cho KyongHo Committed by Joerg Roedel

iommu/exynos: Enhanced error messages

Some redundant error message is removed and some error messages
are changed to error level from debug level.
Signed-off-by: default avatarCho KyongHo <pullip.cho@samsung.com>
Signed-off-by: default avatarShaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent bf4a1c92
...@@ -525,7 +525,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) ...@@ -525,7 +525,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_dbg(dev, "Unable to find IRQ resource\n"); dev_err(dev, "Unable to find IRQ resource\n");
return irq; return irq;
} }
...@@ -787,10 +787,8 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size, ...@@ -787,10 +787,8 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size,
short *pgcnt) short *pgcnt)
{ {
if (size == SPAGE_SIZE) { if (size == SPAGE_SIZE) {
if (!lv2ent_fault(pent)) { if (WARN_ON(!lv2ent_fault(pent)))
WARN(1, "Trying mapping on 4KiB where mapping exists");
return -EADDRINUSE; return -EADDRINUSE;
}
*pent = mk_lv2ent_spage(paddr); *pent = mk_lv2ent_spage(paddr);
pgtable_flush(pent, pent + 1); pgtable_flush(pent, pent + 1);
...@@ -798,9 +796,7 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size, ...@@ -798,9 +796,7 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size,
} else { /* size == LPAGE_SIZE */ } else { /* size == LPAGE_SIZE */
int i; int i;
for (i = 0; i < SPAGES_PER_LPAGE; i++, pent++) { for (i = 0; i < SPAGES_PER_LPAGE; i++, pent++) {
if (!lv2ent_fault(pent)) { if (WARN_ON(!lv2ent_fault(pent))) {
WARN(1,
"Trying mapping on 64KiB where mapping exists");
if (i > 0) if (i > 0)
memset(pent - i, 0, sizeof(*pent) * i); memset(pent - i, 0, sizeof(*pent) * i);
return -EADDRINUSE; return -EADDRINUSE;
...@@ -847,8 +843,8 @@ static int exynos_iommu_map(struct iommu_domain *domain, unsigned long l_iova, ...@@ -847,8 +843,8 @@ static int exynos_iommu_map(struct iommu_domain *domain, unsigned long l_iova,
} }
if (ret) if (ret)
pr_debug("%s: Failed to map iova %#x/%#zx bytes\n", pr_err("%s: Failed(%d) to map %#zx bytes @ %#x\n",
__func__, iova, size); __func__, ret, size, iova);
spin_unlock_irqrestore(&priv->pgtablelock, flags); spin_unlock_irqrestore(&priv->pgtablelock, flags);
...@@ -872,7 +868,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, ...@@ -872,7 +868,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain,
ent = section_entry(priv->pgtable, iova); ent = section_entry(priv->pgtable, iova);
if (lv1ent_section(ent)) { if (lv1ent_section(ent)) {
if (size < SECT_SIZE) { if (WARN_ON(size < SECT_SIZE)) {
err_pgsize = SECT_SIZE; err_pgsize = SECT_SIZE;
goto err; goto err;
} }
...@@ -907,7 +903,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, ...@@ -907,7 +903,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain,
} }
/* lv1ent_large(ent) == true here */ /* lv1ent_large(ent) == true here */
if (size < LPAGE_SIZE) { if (WARN_ON(size < LPAGE_SIZE)) {
err_pgsize = LPAGE_SIZE; err_pgsize = LPAGE_SIZE;
goto err; goto err;
} }
...@@ -929,8 +925,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, ...@@ -929,8 +925,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain,
err: err:
spin_unlock_irqrestore(&priv->pgtablelock, flags); spin_unlock_irqrestore(&priv->pgtablelock, flags);
WARN(1, pr_err("%s: Failed: size(%#zx) @ %#x is smaller than page size %#zx\n",
"%s: Failed due to size(%#zx) @ %#x is smaller than page size %#zx\n",
__func__, size, iova, err_pgsize); __func__, size, iova, err_pgsize);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment