From patchwork Fri Mar 14 05:14:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 3830821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28CB6BF540 for ; Fri, 14 Mar 2014 05:16:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56E83202BE for ; Fri, 14 Mar 2014 05:16:31 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 603562013D for ; Fri, 14 Mar 2014 05:16:30 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKTM-0006p4-0V; Fri, 14 Mar 2014 05:15:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKSx-0000rB-CW; Fri, 14 Mar 2014 05:15:31 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKSu-0000oh-7Y for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 05:15:28 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2E00MVJUK8UR40@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 14:14:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 0B.70.10364.83092235; Fri, 14 Mar 2014 14:14:32 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-22-53229038d9e2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C2.14.28157.83092235; Fri, 14 Mar 2014 14:14:32 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.36.165.149]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2E00F01UK7GB60@mmp2.samsung.com>; Fri, 14 Mar 2014 14:14:32 +0900 (KST) Date: Fri, 14 Mar 2014 14:14:31 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Subject: [PATCH v11 27/27] iommu/exynos: enhanced error messages Message-id: <20140314141431.320b055a618203746b1e3075@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsVy+t8zI12LCUrBBq/2i1ncuXuO1WL+ESDx 6sgPJosF+60tOmdvYLfoXXCVzWLT42usFpd3zWGzmHF+H5PFhRUb2S2mLDrManH4TTurxck/ vYwW62e8ZrGYeWsNiwO/x5OD85g8ZjdcZPH4d7ifyePOtT1sHpuX1HtMvrGc0aNvyypGj8+b 5DyuHD3DFMAZxWWTkpqTWZZapG+XwJWxd8FtxoJFYhUXZj5hbmA8LdjFyMkhIWAicX72ZnYI W0ziwr31bF2MXBxCAssYJRZtPM7YxcgBVvRkYSREfDqjxJtrq6GKJjNJfJ1wC6yIRUBV4l1P DsggNgEtidVzQXq5OEQE2oBqGg+xgDjMAnOZJT5+m8MGUiUs4CDR1X2GFcTmFXCUWPC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ukV5xYm5xaV66XnJ+7iZGcGp4Jr2DcVWDxSFGAQ5GJR7eGUcVg4VYE8uK K3MPMUpwMCuJ8FZFKAUL8aYkVlalFuXHF5XmpBYfYkwGensis5Rocj4wbeWVxBsam5gZWRqZ WRiZmJuTJqwkznuw1TpQSCA9sSQ1OzW1ILUIZgsTB6dUA6OPrEKKZGXKn61HEpJkjva0XH6o 3v+f+xS7ja1J8IowMetE3tQ72xO9+xOO5rIu5nA1O3jJT6Tl1eNdmeZTRfYLH+jaenuJX5ja BaN7Ms3fcpI6gn3Uq+ImNdWZ9yUXVFlN2GzalCNg1/6qqm3XKT7FTfWsClZZ67NqEl72/vxe ydvB0ZqpxFKckWioxVxUnAgAPmYgAlEDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_011528_491530_739AC6F7 X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -6.9 (------) Cc: Kukjin Kim , Prathyush , Grant Grundler , Joerg Roedel , Sachin Kamat , Sylwester Nawrocki , Varun Sethi , Antonios Motakis , Tomasz Figa , Rahul Sharma X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some redundant error message is removed and some error messages are changed to error level from debug level. Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 4888383..b7f7731 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1012,7 +1012,7 @@ static void exynos_iommu_detach_device(struct iommu_domain *domain, dev_dbg(dev, "%s: Detached IOMMU with pgtable %pa\n", __func__, &pgtable); } else { - dev_dbg(dev, "%s: No IOMMU is attached\n", __func__); + dev_err(dev, "%s: No IOMMU is attached\n", __func__); } } @@ -1112,10 +1112,8 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size, short *pgcnt) { if (size == SPAGE_SIZE) { - if (!lv2ent_fault(pent)) { - WARN(1, "Trying mapping on 4KiB where mapping exists"); + if (WARN_ON(!lv2ent_fault(pent))) return -EADDRINUSE; - } *pent = mk_lv2ent_spage(paddr); pgtable_flush(pent, pent + 1); @@ -1123,9 +1121,7 @@ static int lv2set_page(sysmmu_pte_t *pent, phys_addr_t paddr, size_t size, } else { /* size == LPAGE_SIZE */ int i; for (i = 0; i < SPAGES_PER_LPAGE; i++, pent++) { - if (!lv2ent_fault(pent)) { - WARN(1, - "Trying mapping on 64KiB where mapping exists"); + if (WARN_ON(!lv2ent_fault(pent))) { if (i > 0) memset(pent - i, 0, sizeof(*pent) * i); return -EADDRINUSE; @@ -1198,8 +1194,8 @@ static int exynos_iommu_map(struct iommu_domain *domain, unsigned long l_iova, } if (ret) - pr_debug("%s: Failed to map iova %#x/%#zx bytes\n", - __func__, iova, size); + pr_err("%s: Failed(%d) to map %#zx bytes @ %#x\n", + __func__, ret, size, iova); spin_unlock_irqrestore(&priv->pgtablelock, flags); @@ -1236,7 +1232,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, ent = section_entry(priv->pgtable, iova); if (lv1ent_section(ent)) { - if (size < SECT_SIZE) { + if (WARN_ON(size < SECT_SIZE)) { err_pgsize = SECT_SIZE; goto err; } @@ -1271,7 +1267,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, } /* lv1ent_large(ent) == true here */ - if (size < LPAGE_SIZE) { + if (WARN_ON(size < LPAGE_SIZE)) { err_pgsize = LPAGE_SIZE; goto err; } @@ -1290,9 +1286,8 @@ done: err: spin_unlock_irqrestore(&priv->pgtablelock, flags); - WARN(1, - "%s: Failed due to size(%#zx) @ %#x is smaller than page size %#zx\n", - __func__, size, iova, err_pgsize); + pr_err("%s: Failed: size(%#zx) @ %#x is smaller than page size %#zx\n", + __func__, size, iova, err_pgsize); return 0; }