From patchwork Tue Nov 18 19:14:26 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Reimer X-Patchwork-Id: 9540 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 03C48DDE0E for ; Wed, 19 Nov 2008 18:48:33 +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 1L2hlk-00007n-JH; Wed, 19 Nov 2008 07:46:36 +0000 Received: from wf-out-1314.google.com ([209.85.200.175]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1L2W1s-0002g1-SA for linux-mtd@lists.infradead.org; Tue, 18 Nov 2008 19:14:29 +0000 Received: by wf-out-1314.google.com with SMTP id 28so3059920wfc.24 for ; Tue, 18 Nov 2008 11:14:27 -0800 (PST) Received: by 10.142.223.4 with SMTP id v4mr92653wfg.11.1227035666969; Tue, 18 Nov 2008 11:14:26 -0800 (PST) Received: by 10.142.53.18 with HTTP; Tue, 18 Nov 2008 11:14:26 -0800 (PST) Message-ID: Date: Tue, 18 Nov 2008 11:14:26 -0800 From: "Matt Reimer" To: "Linux MTD" Subject: [PATCH] [MTD][NAND] pxa3xx: convert from ns to clock ticks more accurately MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Wed, 19 Nov 2008 02:46:35 -0500 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 20f7872ca476ddb51d5c2ba8257670b73cdeacf5 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 --- 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 0d8ffa6..dcb87af 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -309,7 +309,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, struct pxa3xx_nand_timing *t) -- 1.5.6.3