From patchwork Mon Oct 7 01:58:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2994111 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 69761BF924 for ; Mon, 7 Oct 2013 02:22:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E06D201DE for ; Mon, 7 Oct 2013 02:22:39 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00BCA20174 for ; Mon, 7 Oct 2013 02:22:38 +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 1VT06s-00060f-J9; Mon, 07 Oct 2013 01:59:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VT066-00078f-PN; Mon, 07 Oct 2013 01:58:58 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VT063-00075M-Ta for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2013 01:58:56 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUA00MU705H02F0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2013 10:58:34 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 24.38.17682.A4512525; Mon, 07 Oct 2013 10:58:34 +0900 (KST) X-AuditID: cbfee68e-b7f756d000004512-c0-5252154a86c2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 90.D6.09055.A4512525; Mon, 07 Oct 2013 10:58:34 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.23.118.94]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MUA00HEM05MVZD0@mmp1.samsung.com>; Mon, 07 Oct 2013 10:58:34 +0900 (KST) Date: Mon, 07 Oct 2013 10:58:34 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Subject: [PATCH v10 19/20] iommu/exynos: return 0 if iommu_attach_device() successes Message-id: <20131007105834.8373e2d380e309928bdc8e09@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsVy+t8zY10v0aAggx2LlCzu3D3HajH/CJB4 deQHk8WC/dYWnbM3sFv0LrjKZrHp8TVWi8u75rBZzDi/j8niwoqN7BZTFh1mtTj8pp3V4uSf XkaLluu9TBbrZ7xmsZh5aw2Lg4DHk4PzmDxmN1xk8fh3uJ/J4861PWwem5fUe0y+sZzRo2/L KkaPz5vkPK4cPcMUwBnFZZOSmpNZllqkb5fAlXH/9hHWgj7eioXH37M2ML7i6mLk5JAQMJE4 9mo3K4QtJnHh3nq2LkYuDiGBZYwSJ04cA0pwgBXdXCEPEV/EKLHp5XQmCGcSk8SrfbuYQbpZ BFQlrl59wghiswloSayee5wRpEhEoI1J4mvjIRYQh1ngNLPEqt0rwDqEBcIkLlz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yQXFSem5hnrFibnFpXnpesn5uZsYwWnimdQOxpUNFocYBTgYlXh4d9wP DBJiTSwrrsw9xCjBwawkwnupDijEm5JYWZValB9fVJqTWnyIMRno74nMUqLJ+cAUllcSb2hs YmZkaWRmYWRibk6asJI474FW60AhgfTEktTs1NSC1CKYLUwcnFINjIXXZnjF1kzp1nD0cvx/ c3365mJd9bCWjsuzpt5wKlZtjKgQd2cs8eRKkSuQ38b9prN7bt7V28+7ltX2f/RQN5n48CZn +PWP9frlcudf9MaHv2g4bDKp9vDBxQv0lYze2e+9dzjhNpPQDDuOWwWOTt4l3n7/YrcvK+LN dm3LdNzW975P+8ZDJZbijERDLeai4kQAGvrQlVcDAAA= 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-20131006_215856_262659_AA685BEF X-CRM114-Status: GOOD ( 12.75 ) X-Spam-Score: -6.9 (------) Cc: Kukjin Kim , Prathyush , Grant Grundler , Joerg Roedel , Subash Patel , 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, 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 iommu_attach_device() against exynos-iommu positive integer on success if the caller calls iommu_attach_device() with the same iommu_domain multiple times without call to iommu_detach_device() to inform the caller how many calls to iommu_detach_device() to really detach iommu. However the convention of the return value of success of common API is zero, this patch makes iommu_attach_device() call against exynos-iommu always return zero if the given device is successfully attached to the given iommu_domain even though it is already attached to the same iommu_domain. Reviewed-by: Grant Grundler Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 26ba554..5025338 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -759,15 +759,16 @@ static int exynos_iommu_attach_device(struct iommu_domain *domain, spin_unlock_irqrestore(&priv->lock, flags); - if (ret < 0) + if (ret < 0) { dev_err(dev, "%s: Failed to attach IOMMU with pgtable %#lx\n", __func__, __pa(priv->pgtable)); - else - dev_dbg(dev, "%s: Attached IOMMU with pgtable 0x%lx%s\n", - __func__, __pa(priv->pgtable), - (ret == 0) ? "" : ", again"); + return ret; + } - return ret; + dev_dbg(dev, "%s: Attached IOMMU with pgtable 0x%lx%s\n", + __func__, __pa(priv->pgtable), (ret == 0) ? "" : ", again"); + + return 0; } static void exynos_iommu_detach_device(struct iommu_domain *domain,