From patchwork Sat Mar 8 00:46:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3795881 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1C8B9F43E for ; Sat, 8 Mar 2014 00:44:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23B262034C for ; Sat, 8 Mar 2014 00:44:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BD6A201BF for ; Sat, 8 Mar 2014 00:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753786AbaCHAow (ORCPT ); Fri, 7 Mar 2014 19:44:52 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:56194 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753750AbaCHAot (ORCPT ); Fri, 7 Mar 2014 19:44:49 -0500 Received: from avalon.ideasonboard.com (unknown [91.178.187.5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC6C135ADE; Sat, 8 Mar 2014 01:43:42 +0100 (CET) From: Laurent Pinchart To: linux-omap@vger.kernel.org Cc: iommu@lists.linux-foundation.org, Suman Anna , Florian Vaussard , sakari.ailus@iki.fi Subject: [PATCH 2/5] iommu/omap: Fix 'no page for' debug message in flush_iotlb_page() Date: Sat, 8 Mar 2014 01:46:11 +0100 Message-Id: <1394239574-2389-3-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394239574-2389-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1394239574-2389-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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. Signed-off-by: Laurent Pinchart --- drivers/iommu/omap-iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index bb605c9..cb1e1de 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -376,6 +376,7 @@ static void flush_iotlb_page(struct omap_iommu *obj, u32 da) { int i; struct cr_regs cr; + bool found = false; pm_runtime_get_sync(obj->dev); @@ -394,11 +395,12 @@ 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); + found = true; } } pm_runtime_put_sync(obj->dev); - if (i == obj->nr_tlb_entries) + if (!found) dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da); }