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: 3830791 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 91F959F1CD for ; Fri, 14 Mar 2014 05:15:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBC36202F0 for ; Fri, 14 Mar 2014 05:15:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB2E920306 for ; Fri, 14 Mar 2014 05:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbaCNFPJ (ORCPT ); Fri, 14 Mar 2014 01:15:09 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:24431 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755425AbaCNFPH (ORCPT ); Fri, 14 Mar 2014 01:15:07 -0400 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>; 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 Cc: Antonios Motakis , Grant Grundler , Joerg Roedel , Kukjin Kim , Prathyush , Rahul Sharma , Sachin Kamat , Sylwester Nawrocki , Tomasz Figa , Varun Sethi 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 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsVy+t8zI12LCUrBBq/2i1ncuXuO1WL+ESDx 6sgPJosF+60tOmdvYLfoXXCVzWLT42usFpd3zWGzmHF+H5PFhRUb2S2mLDrManH4TTurxck/ vYwW62e8ZrGYeWsNiwO/x5OD85g8ZjdcZPH4d7ifyePOtT1sHpuX1HtMvrGc0aNvyypGj8+b 5DyuHD3DFMAZxWWTkpqTWZZapG+XwJWxd8FtxoJFYhUXZj5hbmA8LdjFyMkhIWAicX72ZnYI W0ziwr31bF2MXBxCAssYJRZtPM7YxcgBVvRkYSREfDqjxJtrq6GKJjNJfJ1wC6yIRUBV4l1P DsggNgEtidVzQXq5OEQE2oBqGg+xgDjMAnOZJT5+m8MGUiUs4CDR1X2GFcTmFXCUWPCrmwXi DAuJC00d7BBxQYkfk++BxZmBpm7e1sQKYctLbF7zlhlkqIRAJ4fEhCWXGEESLAICEt8mg2wD OVtWYtM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aYkVlalFuXHF5XmpBYfYkwGensis5Rocj4wbeWVxBsam5gZWRqZ WRiZmJuTJqwkznuw1TpQSCA9sSQ1OzW1ILUIZgsTB6dUA6OPrEKKZGXKn61HEpJkjva0XH6o 3v+f+xS7ja1J8IowMetE3tQ72xO9+xOO5rIu5nA1O3jJT6Tl1eNdmeZTRfYLH+jaenuJX5ja BaN7Ms3fcpI6gn3Uq+ImNdWZ9yUXVFlN2GzalCNg1/6qqm3XKT7FTfWsClZZ67NqEl72/vxe ydvB0ZqpxFKckWioxVxUnAgAPmYgAlEDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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; }