aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-06 13:34:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-06 13:34:48 -0400
commitaf9b9a53fa0a86921edb86973f9661ccc7ddb90d (patch)
tree7750d7ca27f373d1127439dc841171cdbb901a4a
parent9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb (diff)
parent48f8b641297df49021093763a3271119a84990a2 (diff)
Merge tag 'for-linus-20120706' of git://git.infradead.org/linux-mtd
Pull two MTD fixes from David Woodhouse: - Fix a logic error in OLPC CAFÉ NAND ready() function. - Fix regression due to bitflip handling changes. * tag 'for-linus-20120706' of git://git.infradead.org/linux-mtd: mtd: cafe_nand: fix an & vs | mistake mtd: nand: initialize bitflip_threshold prior to BBT scanning
-rw-r--r--drivers/mtd/nand/cafe_nand.c2
-rw-r--r--drivers/mtd/nand/nand_base.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 41371ba1a811..f3f6cfedd69e 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -102,7 +102,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
102static int cafe_device_ready(struct mtd_info *mtd) 102static int cafe_device_ready(struct mtd_info *mtd)
103{ 103{
104 struct cafe_priv *cafe = mtd->priv; 104 struct cafe_priv *cafe = mtd->priv;
105 int result = !!(cafe_readl(cafe, NAND_STATUS) | 0x40000000); 105 int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000);
106 uint32_t irqs = cafe_readl(cafe, NAND_IRQ); 106 uint32_t irqs = cafe_readl(cafe, NAND_IRQ);
107 107
108 cafe_writel(cafe, irqs, NAND_IRQ); 108 cafe_writel(cafe, irqs, NAND_IRQ);
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index d47586cf64ce..a11253a0fcab 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3501,6 +3501,13 @@ int nand_scan_tail(struct mtd_info *mtd)
3501 /* propagate ecc info to mtd_info */ 3501 /* propagate ecc info to mtd_info */
3502 mtd->ecclayout = chip->ecc.layout; 3502 mtd->ecclayout = chip->ecc.layout;
3503 mtd->ecc_strength = chip->ecc.strength; 3503 mtd->ecc_strength = chip->ecc.strength;
3504 /*
3505 * Initialize bitflip_threshold to its default prior scan_bbt() call.
3506 * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be
3507 * properly set.
3508 */
3509 if (!mtd->bitflip_threshold)
3510 mtd->bitflip_threshold = mtd->ecc_strength;
3504 3511
3505 /* Check, if we should skip the bad block table scan */ 3512 /* Check, if we should skip the bad block table scan */
3506 if (chip->options & NAND_SKIP_BBTSCAN) 3513 if (chip->options & NAND_SKIP_BBTSCAN)