aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/davinci_nand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/davinci_nand.c')
-rw-r--r--drivers/mtd/nand/davinci_nand.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 8beb0d0233b5..a90fde3ede28 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -316,7 +316,7 @@ static int nand_davinci_correct_4bit(struct mtd_info *mtd,
316 u32 syndrome[4]; 316 u32 syndrome[4];
317 u32 ecc_state; 317 u32 ecc_state;
318 unsigned num_errors, corrected; 318 unsigned num_errors, corrected;
319 unsigned long timeo = jiffies + msecs_to_jiffies(100); 319 unsigned long timeo;
320 320
321 /* All bytes 0xff? It's an erased page; ignore its ECC. */ 321 /* All bytes 0xff? It's an erased page; ignore its ECC. */
322 for (i = 0; i < 10; i++) { 322 for (i = 0; i < 10; i++) {
@@ -372,9 +372,11 @@ compare:
372 * after setting the 4BITECC_ADD_CALC_START bit. So if you immediately 372 * after setting the 4BITECC_ADD_CALC_START bit. So if you immediately
373 * begin trying to poll for the state, you may fall right out of your 373 * begin trying to poll for the state, you may fall right out of your
374 * loop without any of the correction calculations having taken place. 374 * loop without any of the correction calculations having taken place.
375 * The recommendation from the hardware team is to wait till ECC_STATE 375 * The recommendation from the hardware team is to initially delay as
376 * reads less than 4, which means ECC HW has entered correction state. 376 * long as ECC_STATE reads less than 4. After that, ECC HW has entered
377 * correction state.
377 */ 378 */
379 timeo = jiffies + usecs_to_jiffies(100);
378 do { 380 do {
379 ecc_state = (davinci_nand_readl(info, 381 ecc_state = (davinci_nand_readl(info,
380 NANDFSR_OFFSET) >> 8) & 0x0f; 382 NANDFSR_OFFSET) >> 8) & 0x0f;
@@ -733,6 +735,9 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
733 * breaks userspace ioctl interface with mtd-utils. Once we 735 * breaks userspace ioctl interface with mtd-utils. Once we
734 * resolve this issue, NAND_ECC_HW_OOB_FIRST mode can be used 736 * resolve this issue, NAND_ECC_HW_OOB_FIRST mode can be used
735 * for the 4KiB page chips. 737 * for the 4KiB page chips.
738 *
739 * TODO: Note that nand_ecclayout has now been expanded and can
740 * hold plenty of OOB entries.
736 */ 741 */
737 dev_warn(&pdev->dev, "no 4-bit ECC support yet " 742 dev_warn(&pdev->dev, "no 4-bit ECC support yet "
738 "for 4KiB-page NAND\n"); 743 "for 4KiB-page NAND\n");