[MTD] [NAND] pxa3xx: convert from ns to clock ticks more accurately

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 5 07:59:02 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5b0d4d7c8a67c5ba3d35e6ceb0c5530cc6846db7
Commit:     5b0d4d7c8a67c5ba3d35e6ceb0c5530cc6846db7
Parent:     7f9938d0fd6c778bd0ce296a3e3b50266de2b892
Author:     Matt Reimer <mreimer at vpop.net>
AuthorDate: Tue Nov 18 10:54:32 2008 -0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jan 5 13:03:20 2009 +0100

    [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 <mreimer at vpop.net>
    Signed-off-by: Eric Miao <eric.miao at marvell.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 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 7582581..cc55cbc 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -298,7 +298,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)



More information about the linux-mtd-cvs mailing list