From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antonios Motakis 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> References: <1381497887-14586-1-git-send-email-a.motakis@virtualopensystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381497887-14586-1-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Will Deacon , Joerg Roedel , "moderated list:ARM SMMU DRIVER" , open list Cc: agraf-l3A5Bk7waGM@public.gmane.org, B08248-KZfg59tc24xl57MIdRCFDg@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Antonios Motakis , tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org, kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org List-Id: iommu@lists.linux-foundation.org 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, -- 1.8.1.2