aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-02 17:08:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-02 17:08:53 -0400
commit7a883eaf62f4b943ebec738ce3b0796c67ef5d32 (patch)
tree8c7382552b62a8f1629ce77a2ababb99ebe95112 /drivers
parent628506c8de058f94297dae1f8ef8caaea29c4369 (diff)
parent515495a1da9abf339b922b7919c4950e85b87b42 (diff)
Merge git://git.infradead.org/~dwmw2/mtd-2.6.23
* git://git.infradead.org/~dwmw2/mtd-2.6.23: [MTD] [NAND] nand_base.c: fix type of eccpos pointer [MTD] [NAND] at91_nand rdy_pin fix [MTD] [NAND] fix race in nand_base.c [MTD] [NAND] Fix refactoring of EDB7312 hwcontrol function. [MTD] Fix potential leak in rfd_ftl_add_mtd [JFFS2] Print correct node offset when complaining about broken data CRC [JFFS2] Fix suspend failure with JFFS2 GC thread. [JFFS2] Deletion dirents should be REF_NORMAL, not REF_PRISTINE. [JFFS2] Prevent oops after 'node added in wrong place' debug check
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/at91_nand.c5
-rw-r--r--drivers/mtd/nand/edb7312.c10
-rw-r--r--drivers/mtd/nand/nand_base.c12
-rw-r--r--drivers/mtd/rfd_ftl.c1
4 files changed, 18 insertions, 10 deletions
diff --git a/drivers/mtd/nand/at91_nand.c b/drivers/mtd/nand/at91_nand.c
index 512e999177f7..b2a5672df6e0 100644
--- a/drivers/mtd/nand/at91_nand.c
+++ b/drivers/mtd/nand/at91_nand.c
@@ -128,7 +128,10 @@ static int __init at91_nand_probe(struct platform_device *pdev)
128 nand_chip->IO_ADDR_R = host->io_base; 128 nand_chip->IO_ADDR_R = host->io_base;
129 nand_chip->IO_ADDR_W = host->io_base; 129 nand_chip->IO_ADDR_W = host->io_base;
130 nand_chip->cmd_ctrl = at91_nand_cmd_ctrl; 130 nand_chip->cmd_ctrl = at91_nand_cmd_ctrl;
131 nand_chip->dev_ready = at91_nand_device_ready; 131
132 if (host->board->rdy_pin)
133 nand_chip->dev_ready = at91_nand_device_ready;
134
132 nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */ 135 nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */
133 nand_chip->chip_delay = 20; /* 20us command delay time */ 136 nand_chip->chip_delay = 20; /* 20us command delay time */
134 137
diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
index 1daf8231aaef..0146cdc48039 100644
--- a/drivers/mtd/nand/edb7312.c
+++ b/drivers/mtd/nand/edb7312.c
@@ -74,7 +74,7 @@ static struct mtd_partition partition_info[] = {
74/* 74/*
75 * hardware specific access to control-lines 75 * hardware specific access to control-lines
76 * 76 *
77 * NAND_NCE: bit 0 -> bit 7 77 * NAND_NCE: bit 0 -> bit 6 (bit 7 = 1)
78 * NAND_CLE: bit 1 -> bit 4 78 * NAND_CLE: bit 1 -> bit 4
79 * NAND_ALE: bit 2 -> bit 5 79 * NAND_ALE: bit 2 -> bit 5
80 */ 80 */
@@ -83,12 +83,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
83 struct nand_chip *chip = mtd->priv; 83 struct nand_chip *chip = mtd->priv;
84 84
85 if (ctrl & NAND_CTRL_CHANGE) { 85 if (ctrl & NAND_CTRL_CHANGE) {
86 unsigned char bits; 86 unsigned char bits = 0x80;
87 87
88 bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3; 88 bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3;
89 bits = (ctrl & NAND_NCE) << 7; 89 bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40;
90 90
91 clps_writeb((clps_readb(ep7312_pxdr) & 0xB0) | 0x10, 91 clps_writeb((clps_readb(ep7312_pxdr) & 0xF0) | bits,
92 ep7312_pxdr); 92 ep7312_pxdr);
93 } 93 }
94 if (cmd != NAND_CMD_NONE) 94 if (cmd != NAND_CMD_NONE)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 7e68203fe1ba..24ac6778b1a8 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -24,6 +24,7 @@
24 * if we have HW ecc support. 24 * if we have HW ecc support.
25 * The AG-AND chips have nice features for speed improvement, 25 * The AG-AND chips have nice features for speed improvement,
26 * which are not supported yet. Read / program 4 pages in one go. 26 * which are not supported yet. Read / program 4 pages in one go.
27 * BBT table is not serialized, has to be fixed
27 * 28 *
28 * This program is free software; you can redistribute it and/or modify 29 * This program is free software; you can redistribute it and/or modify
29 * it under the terms of the GNU General Public License version 2 as 30 * it under the terms of the GNU General Public License version 2 as
@@ -360,6 +361,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
360 /* We write two bytes, so we dont have to mess with 16 bit 361 /* We write two bytes, so we dont have to mess with 16 bit
361 * access 362 * access
362 */ 363 */
364 nand_get_device(chip, mtd, FL_WRITING);
363 ofs += mtd->oobsize; 365 ofs += mtd->oobsize;
364 chip->ops.len = chip->ops.ooblen = 2; 366 chip->ops.len = chip->ops.ooblen = 2;
365 chip->ops.datbuf = NULL; 367 chip->ops.datbuf = NULL;
@@ -367,9 +369,11 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
367 chip->ops.ooboffs = chip->badblockpos & ~0x01; 369 chip->ops.ooboffs = chip->badblockpos & ~0x01;
368 370
369 ret = nand_do_write_oob(mtd, ofs, &chip->ops); 371 ret = nand_do_write_oob(mtd, ofs, &chip->ops);
372 nand_release_device(mtd);
370 } 373 }
371 if (!ret) 374 if (!ret)
372 mtd->ecc_stats.badblocks++; 375 mtd->ecc_stats.badblocks++;
376
373 return ret; 377 return ret;
374} 378}
375 379
@@ -768,7 +772,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
768 uint8_t *p = buf; 772 uint8_t *p = buf;
769 uint8_t *ecc_calc = chip->buffers->ecccalc; 773 uint8_t *ecc_calc = chip->buffers->ecccalc;
770 uint8_t *ecc_code = chip->buffers->ecccode; 774 uint8_t *ecc_code = chip->buffers->ecccode;
771 int *eccpos = chip->ecc.layout->eccpos; 775 uint32_t *eccpos = chip->ecc.layout->eccpos;
772 776
773 chip->ecc.read_page_raw(mtd, chip, buf); 777 chip->ecc.read_page_raw(mtd, chip, buf);
774 778
@@ -810,7 +814,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
810 uint8_t *p = buf; 814 uint8_t *p = buf;
811 uint8_t *ecc_calc = chip->buffers->ecccalc; 815 uint8_t *ecc_calc = chip->buffers->ecccalc;
812 uint8_t *ecc_code = chip->buffers->ecccode; 816 uint8_t *ecc_code = chip->buffers->ecccode;
813 int *eccpos = chip->ecc.layout->eccpos; 817 uint32_t *eccpos = chip->ecc.layout->eccpos;
814 818
815 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { 819 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
816 chip->ecc.hwctl(mtd, NAND_ECC_READ); 820 chip->ecc.hwctl(mtd, NAND_ECC_READ);
@@ -1416,7 +1420,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
1416 int eccsteps = chip->ecc.steps; 1420 int eccsteps = chip->ecc.steps;
1417 uint8_t *ecc_calc = chip->buffers->ecccalc; 1421 uint8_t *ecc_calc = chip->buffers->ecccalc;
1418 const uint8_t *p = buf; 1422 const uint8_t *p = buf;
1419 int *eccpos = chip->ecc.layout->eccpos; 1423 uint32_t *eccpos = chip->ecc.layout->eccpos;
1420 1424
1421 /* Software ecc calculation */ 1425 /* Software ecc calculation */
1422 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) 1426 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
@@ -1442,7 +1446,7 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1442 int eccsteps = chip->ecc.steps; 1446 int eccsteps = chip->ecc.steps;
1443 uint8_t *ecc_calc = chip->buffers->ecccalc; 1447 uint8_t *ecc_calc = chip->buffers->ecccalc;
1444 const uint8_t *p = buf; 1448 const uint8_t *p = buf;
1445 int *eccpos = chip->ecc.layout->eccpos; 1449 uint32_t *eccpos = chip->ecc.layout->eccpos;
1446 1450
1447 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { 1451 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
1448 chip->ecc.hwctl(mtd, NAND_ECC_WRITE); 1452 chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index d4b1ba8f23ef..006c03aacb55 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -779,6 +779,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
779 else { 779 else {
780 if (!mtd->erasesize) { 780 if (!mtd->erasesize) {
781 printk(KERN_WARNING PREFIX "please provide block_size"); 781 printk(KERN_WARNING PREFIX "please provide block_size");
782 kfree(part);
782 return; 783 return;
783 } 784 }
784 else 785 else