From patchwork Wed Dec 10 15:26:09 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Miao X-Patchwork-Id: 13175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7A869474C1 for ; Thu, 11 Dec 2008 02:27:47 +1100 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1LAQx1-0000Pl-Ss; Wed, 10 Dec 2008 15:26:11 +0000 Received: from rv-out-0708.google.com ([209.85.198.240]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1LAQx0-0000Pc-5V for linux-mtd@lists.infradead.org; Wed, 10 Dec 2008 15:26:10 +0000 Received: by rv-out-0708.google.com with SMTP id b17so451866rvf.42 for ; Wed, 10 Dec 2008 07:26:09 -0800 (PST) Received: by 10.141.198.9 with SMTP id a9mr724458rvq.62.1228922769080; Wed, 10 Dec 2008 07:26:09 -0800 (PST) Received: by 10.141.178.15 with HTTP; Wed, 10 Dec 2008 07:26:09 -0800 (PST) Message-ID: Date: Wed, 10 Dec 2008 23:26:09 +0800 From: "Eric Miao" To: linux-mtd Subject: [PATCH 2/2] [MTD][NAND] pxa3xx: convert from ns to clock ticks more accurately MIME-Version: 1.0 Content-Disposition: inline X-Spam-Score: 0.0 (/) Cc: David Woodhouse , ARM Linux X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org >From e12b9d1a578bc2d70dc2233af3caf06e672dfcce Mon Sep 17 00:00:00 2001 From: Matt Reimer Date: Tue, 18 Nov 2008 10:54:32 -0800 Subject: [PATCH] [MTD][NAND] pxa3xx: convert from ns to clock ticks more accurately The various fields in NDTR{01} are in units of clock ticks minus one, but the ns2cycle macro mistakenly adds one, inflating the number of clock ticks and making it impossible to set any of these fields to zero. Signed-off-by: Matt Reimer Signed-off-by: Eric Miao --- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index b797c1c..1e4f383 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -297,7 +297,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = { #define NDTR1_tAR(c) (min((c), 15) << 0) /* convert nano-seconds to nand flash controller clock cycles */ -#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) + 1) +#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) - 1) static void pxa3xx_nand_set_timing(struct pxa3xx_nand_info *info, const struct pxa3xx_nand_timing *t)