From patchwork Fri Jul 26 11:31:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2834019 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 CAD8FC0319 for ; Fri, 26 Jul 2013 11:31:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03B68201DB for ; Fri, 26 Jul 2013 11:31:53 +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 4251E201C0 for ; Fri, 26 Jul 2013 11:31:51 +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 1V2gFH-0004aD-1T; Fri, 26 Jul 2013 11:31:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2gF5-00067P-HT; Fri, 26 Jul 2013 11:31:27 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2gF1-00064e-Rl for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 11:31:25 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MQJ00KRDJZQAOP0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 20:31:02 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id E7.7A.03969.6FD52F15; Fri, 26 Jul 2013 20:31:02 +0900 (KST) X-AuditID: cbfee68f-b7f436d000000f81-eb-51f25df620b8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BA.7B.32250.5FD52F15; Fri, 26 Jul 2013 20:31:02 +0900 (KST) Received: from DOPULLIPCHO07 ([12.23.118.94]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MQJ006U4JZP5E70@mmp2.samsung.com>; Fri, 26 Jul 2013 20:31:01 +0900 (KST) From: Cho KyongHo To: 'Linux ARM Kernel' , 'Linux IOMMU' , 'Linux Kernel' , 'Linux Samsung SOC' Subject: [PATCH v8 12/12] iommu/exynos: return 0 if iommu_attach_device() successes Date: Fri, 26 Jul 2013 20:31:01 +0900 Message-id: <004201ce89f3$9b849a20$d28dce60$@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac6J8ddcRcOchBS4TTmrJyDxnOe5pw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42I5/e+Zse632E+BBjd+c1vcuXuO1eLVkR9M Fgv2W1t0zt7AbrH54DoWi94FV9ksGu9NYLP4eOo4u8Wmx9dYLS7vmsNmMeP8PiaLCys2sltM WXSY1eLkn15Gi5brvUwO/B5PDs5j8pjdcJHF4861PWwe5zetYfbYvKTeY/KN5YwefVtWMXp8 3iTnceXoGaYAzigum5TUnMyy1CJ9uwSujM4NHUwFt3kqVq77ytrAuIuri5GDQ0LARGLy0vQu Rk4gU0ziwr31bF2MXBxCAssYJa717GaEqXn7pRoiPp1Rovv6ZKiiv4wSPy89ZwPpZhPQklg9 9zgjiC0icJdR4uV5HpAiZoHbzBLTfr4CSwgLhErM7t3AAm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x4+xrqGV6Er/fdTFD1IhI7Hvx jnECo8AsJKNmIRk1C8moWUhaFjCyrGIUTS1ILihOSs811CtOzC0uzUvXS87P3cQITjHPpHYw rmywOMQowMGoxMOr4PQxUIg1say4MvcQowQHs5II73XvT4FCvCmJlVWpRfnxRaU5qcWHGJOB Pp3ILCWanA9Mf3kl8YbGJmZGlkZmFkYm5uakCSuJ8x5otQ4UEkhPLEnNTk0tSC2C2cLEwSnV wJgYs8vizvqKa5c/92yfVsn69JFXlWTCC5mCqUKsye+XHPETbQ5P/vp1caWVm99BR8Hbh+KE xbJuZnPsb+EUMFvSatAXoB0eynYudE09Q3Ti5LlaafFNp5rVj+xTm++uVrwgndvd/Ur41Akz 4wM/zWwX718R1uul9Mdxd7XUb9aygzo3/GX9lFiKMxINtZiLihMB2CXocnUDAAA= 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-20130726_073124_266270_5EE23137 X-CRM114-Status: GOOD ( 11.63 ) X-Spam-Score: -8.3 (--------) Cc: 'Kukjin Kim' , 'Hyunwoong Kim' , 'Prathyush' , 'Grant Grundler' , 'Joerg Roedel' , 'Keyyoung Park' , 'Subash Patel' , 'Sachin Kamat' , 'Antonios Motakis' , kvmarm@lists.cs.columbia.edu, '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=-5.7 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. Signed-off-by: Cho KyongHo Reviewed-by: Grant Grundler --- 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 51e5b35..6eed6d6 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -882,15 +882,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,