From patchwork Fri Oct 11 13:24:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonios Motakis X-Patchwork-Id: 3024231 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 43541BF924 for ; Fri, 11 Oct 2013 13:25:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2BE1201F8 for ; Fri, 11 Oct 2013 13:25:47 +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 DB52620255 for ; Fri, 11 Oct 2013 13:25:42 +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 1VUcim-0006qM-Kr; Fri, 11 Oct 2013 13:25:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUcik-0000MQ-5i; Fri, 11 Oct 2013 13:25:34 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUcih-0000Kr-CH for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2013 13:25:31 +0000 Received: by mail-wi0-f182.google.com with SMTP id ez12so1044287wid.3 for ; Fri, 11 Oct 2013 06:25:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gdvMc3kNMqcf/yJKpKiXkpYC885SlfVIqbIrqDB5WTw=; b=ZPMiTfnQyjJeI+R1S8cfQCoAxzbxgSdhTqYIaWau94EZg2RvOCIlu+VZv7TNeEY7Nm QS+mOCmLdkkp0DmajpbBLOa/RGmpXuaNk34lY/D0/yVL+1HHML1D25Zw4wsErtFyZcmm tKnVvkJRxBsnqdT8QNCBarqN9ip2zr0+1Un55sTjXAAZjoc1QRCq5npT10b79PFoqUtG +mV76mCZ9HG64c1zIfPG0+/p0MdFCTVHsrEsCCcYEeW99kPjCeOUjiYN/J8nJBoHVu8M ZY5WUxSnZ4PGgKwh++cS5c4LQoe3s/Jpp7dQpWbAvRmCyseYEw3ooFi3jiCsyz4Cydii 7LRw== X-Gm-Message-State: ALoCoQnhrR+Fd2eN8w+SySCbGQySH9x/rhK+nrLdoK3MHXQoEtuHTbT92Vcty5g4aaA159hg4EC+ X-Received: by 10.180.189.132 with SMTP id gi4mr3221760wic.19.1381497903765; Fri, 11 Oct 2013 06:25:03 -0700 (PDT) Received: from localhost.localdomain (home.tvelocity.eu. [82.67.68.96]) by mx.google.com with ESMTPSA id s4sm5734962wiy.1.2013.10.11.06.25.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 06:25:02 -0700 (PDT) From: Antonios Motakis To: Will Deacon , Joerg Roedel , linux-arm-kernel@lists.infradead.org (moderated list:ARM SMMU DRIVER), iommu@lists.linux-foundation.org (open list:IOMMU DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] ARM: SMMU: return NULL on error in arm_smmu_iova_to_phys Date: Fri, 11 Oct 2013 15:24:47 +0200 Message-Id: <1381497887-14586-2-git-send-email-a.motakis@virtualopensystems.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381497887-14586-1-git-send-email-a.motakis@virtualopensystems.com> References: <1381497887-14586-1-git-send-email-a.motakis@virtualopensystems.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131011_092531_512148_26E8D24A X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -2.6 (--) Cc: agraf@suse.de, B08248@freescale.com, iommu@lists.linux-foundation.org, Antonios Motakis , tech@virtualopensystems.com, kvmarm@lists.cs.columbia.edu 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: , MIME-Version: 1.0 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.4 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 The return value of arm_smmu_iova_to_phys is directly passed to the user of the IOMMU API via iommu_iova_to_phys; however the ARM SMMU driver returns -EINVAL on error, which is not consistent with the rest of the drivers implementing the IOMMU API. VFIO also relies on the call returning NULL when a page has not been mapped already. Signed-off-by: Antonios Motakis --- drivers/iommu/arm-smmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 8b71332..fe81b20 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1480,10 +1480,7 @@ static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain, err_unlock: spin_unlock(&smmu_domain->lock); - dev_warn(smmu->dev, - "invalid (corrupt?) page tables detected for iova 0x%llx\n", - (unsigned long long)iova); - return -EINVAL; + return NULL; } static int arm_smmu_domain_has_cap(struct iommu_domain *domain,