From patchwork Wed Jul 5 16:29:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 784730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3x2mbQ5rGMz9s71 for ; Thu, 6 Jul 2017 02:31:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t8pFr/XP"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751796AbdGEQba (ORCPT ); Wed, 5 Jul 2017 12:31:30 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36231 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbdGEQb3 (ORCPT ); Wed, 5 Jul 2017 12:31:29 -0400 Received: by mail-lf0-f66.google.com with SMTP id f28so21434907lfi.3 for ; Wed, 05 Jul 2017 09:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=D3tzEWBxo8KLIdfPJMlvdlRhKPVVZIF7x4oC804cITs=; b=t8pFr/XPMbDBjhHYaUDUE2/Pm0f8qigfs6mnw4DW9xRi/GxdH4raDEBttY6+RzJjQF /sNnMWGMXJYy+3IizKbTHVbho00uw5LKje42QyR5Ig/QyQH+gHFG4czRQMuWOjdV9zb2 cVGI3hqjV2sDVRNwakyS3mrPgBV1MG0ny5FVYZNugl7omiDBSg8XRiKcfZot4Ji6wSU/ k2I+gr3KcTvUgl7koyDr1q5mhSAuApLZF2RjppqWhjOB6tSVZKQfnbaY58YRhvsPtpRS zYUZfB+wrHiDlERGFh3v2naigLSipHY4YV/NGiSV/stRtudxkqFDw754eBRjVL7lIghs rYcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=D3tzEWBxo8KLIdfPJMlvdlRhKPVVZIF7x4oC804cITs=; b=hriv/xCy6mQQauW+i0SkbnE05IrtWIhcebXGWNz8DkuCyahxYURgnRjFOKKSiUjaIa BQXmps+9SSmu/6Ht/Ge1esPn9TbM5wnO7lC6O6Jio7RvypGEjIRlRaUhoupKQyhD7ZSK m/dL780SBER9yZ3TyfPUh12HdIu5YTI7y7CRyPe/vR1PvSrXY0DaK4XcVNwtSJ3lNZRB 7s0++fAyppoUZa1Tph+kWv+kEEqDEG/dfJypMn+fhdTi6dUuZvX2uh1p1v0X4Xoi04D6 W9PzdxquVplbuyX3m/f72R0myQ46xf2RPZ16Z04XiiFeVJT24Q4U6gFWF//3E2BkMFZV gmog== X-Gm-Message-State: AKS2vOxAdO30rAEA5tBezni2bvvF/u/9WGIT8AsFZnMyme8fTjvKJ8EY gPoUO4c1AoMwqA== X-Received: by 10.46.87.93 with SMTP id r29mr13472784ljd.68.1499272288329; Wed, 05 Jul 2017 09:31:28 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-87.pppoe.spdop.ru. [109.252.91.87]) by smtp.gmail.com with ESMTPSA id x11sm4260108ljd.5.2017.07.05.09.31.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 09:31:27 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Joerg Roedel , Jonathan Hunter Cc: Hiroshi Doyu , linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org Subject: [PATCH v1 4/4] iommu/tegra: gart: Correct number of unmapped bytes Date: Wed, 5 Jul 2017 19:29:48 +0300 Message-Id: X-Mailer: git-send-email 2.13.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org The iommu_unmap() treats zero bytes number returned by an IOMMU driver as an indicator that unmapping should be stopped. As a result, GART driver unmaps only the first page entry of the whole range, which is incorrect. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 55fdb56d85ea..c622f4a4bedd 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -309,7 +309,7 @@ static size_t gart_iommu_unmap(struct iommu_domain *domain, unsigned long iova, gart_set_pte(gart, iova, 0); FLUSH_GART_REGS(gart); spin_unlock_irqrestore(&gart->pte_lock, flags); - return 0; + return bytes; } static phys_addr_t gart_iommu_iova_to_phys(struct iommu_domain *domain,