From patchwork Thu Apr 3 20:01:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3933921 Return-Path: X-Original-To: patchwork-linux-omap@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 7A453BFF02 for ; Thu, 3 Apr 2014 19:59:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4BDD202EA for ; Thu, 3 Apr 2014 19:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17F2820303 for ; Thu, 3 Apr 2014 19:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582AbaDCT7w (ORCPT ); Thu, 3 Apr 2014 15:59:52 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:51607 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753455AbaDCT7n (ORCPT ); Thu, 3 Apr 2014 15:59:43 -0400 Received: from avalon.ideasonboard.com (unknown [91.177.168.144]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 64E46359CA; Thu, 3 Apr 2014 21:57:57 +0200 (CEST) From: Laurent Pinchart To: linux-omap@vger.kernel.org Cc: iommu@lists.linux-foundation.org, Suman Anna , Florian Vaussard , Sakari Ailus Subject: [PATCH v2 4/6] iommu/omap: Fix 'no page for' debug message in flush_iotlb_page() Date: Thu, 3 Apr 2014 22:01:36 +0200 Message-Id: <1396555298-25246-5-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1396555298-25246-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1396555298-25246-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 flush_iotlb_page() function prints a debug message when no corresponding page was found in the TLB. That condition is incorrectly checked and always resolves to true, given that the for_each_iotlb_cr() loop is never interrupted and always reaches obj->nr_tlb_entries. Given that we can't have two TLB entries for the same VA, break from the loop when a match is found. Signed-off-by: Laurent Pinchart Acked-by: Suman Anna --- drivers/iommu/omap-iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index fdf3dd0..428b47a 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -394,6 +394,7 @@ static void flush_iotlb_page(struct omap_iommu *obj, u32 da) __func__, start, da, bytes); iotlb_load_cr(obj, &cr); iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); + break; } } pm_runtime_put_sync(obj->dev);