From patchwork Thu Apr 3 20:01:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3933911 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 DF7569F334 for ; Thu, 3 Apr 2014 19:59:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 158EF202FF for ; Thu, 3 Apr 2014 19:59:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EEAE202EA for ; Thu, 3 Apr 2014 19:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515AbaDCT7n (ORCPT ); Thu, 3 Apr 2014 15:59:43 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:51601 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753455AbaDCT7l (ORCPT ); Thu, 3 Apr 2014 15:59:41 -0400 Received: from avalon.ideasonboard.com (unknown [91.177.168.144]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 394E6359AE; Thu, 3 Apr 2014 21:57:56 +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 1/6] iommu/omap: Correct init value of iotlb_entry valid field Date: Thu, 3 Apr 2014 22:01:33 +0200 Message-Id: <1396555298-25246-2-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 From: Suman Anna The iotlb_entry field values are used directly in omap2_alloc_cr, a function used in preparing the MMU_CAM and MMU_RAM registers. The iotlb_entry.valid value is being set incorrectly to 1 at the moment, and this would result in overriding the PAGESIZE bit field of the MMU_CAM register if prefetching of the entries were to be supported. The bug has not caused any MMU faults due to incorrect size programming so far as the prefetching is disabled by default. Fix this by using the correct init value for the iotlb_entry.valid field. Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 8acea87..4716af1 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1043,7 +1043,7 @@ static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, e->da = da; e->pa = pa; - e->valid = 1; + e->valid = MMU_CAM_V; /* FIXME: add OMAP1 support */ e->pgsz = flags & MMU_CAM_PGSZ_MASK; e->endian = flags & MMU_RAM_ENDIAN_MASK;