aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2010-12-10 05:04:20 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-01-06 10:23:10 -0500
commite0c1a921f62d22d1aa62c72ddb793f898945ff5a (patch)
treeaee490559dfea9e103f6880dc7b022fdf549d37b /drivers
parent263a8c8635445c0ede3cb22c98a1a12da4672ebc (diff)
mtd: OneNAND: lighten scary initial bad block messages
Initial bad blocks are normal but the messages look like errors. Make the messages less scary, make the main message an informational message not a warning, make the message displaying registers a debug message and include the address there instead of in the informational message. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/onenand/onenand_base.c22
-rw-r--r--drivers/mtd/onenand/onenand_bbt.c4
2 files changed, 14 insertions, 12 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 88f23e3f3014..2d7c90de3144 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1484,8 +1484,7 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
1484{ 1484{
1485 struct onenand_chip *this = mtd->priv; 1485 struct onenand_chip *this = mtd->priv;
1486 unsigned long timeout; 1486 unsigned long timeout;
1487 unsigned int interrupt; 1487 unsigned int interrupt, ctrl, ecc, addr1, addr8;
1488 unsigned int ctrl;
1489 1488
1490 /* The 20 msec is enough */ 1489 /* The 20 msec is enough */
1491 timeout = jiffies + msecs_to_jiffies(20); 1490 timeout = jiffies + msecs_to_jiffies(20);
@@ -1497,25 +1496,28 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
1497 /* To get correct interrupt status in timeout case */ 1496 /* To get correct interrupt status in timeout case */
1498 interrupt = this->read_word(this->base + ONENAND_REG_INTERRUPT); 1497 interrupt = this->read_word(this->base + ONENAND_REG_INTERRUPT);
1499 ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS); 1498 ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);
1499 addr1 = this->read_word(this->base + ONENAND_REG_START_ADDRESS1);
1500 addr8 = this->read_word(this->base + ONENAND_REG_START_ADDRESS8);
1500 1501
1501 if (interrupt & ONENAND_INT_READ) { 1502 if (interrupt & ONENAND_INT_READ) {
1502 int ecc = onenand_read_ecc(this); 1503 ecc = onenand_read_ecc(this);
1503 if (ecc & ONENAND_ECC_2BIT_ALL) { 1504 if (ecc & ONENAND_ECC_2BIT_ALL) {
1504 printk(KERN_WARNING "%s: ecc error = 0x%04x, " 1505 printk(KERN_DEBUG "%s: ecc 0x%04x ctrl 0x%04x "
1505 "controller error 0x%04x\n", 1506 "intr 0x%04x addr1 %#x addr8 %#x\n",
1506 __func__, ecc, ctrl); 1507 __func__, ecc, ctrl, interrupt, addr1, addr8);
1507 return ONENAND_BBT_READ_ECC_ERROR; 1508 return ONENAND_BBT_READ_ECC_ERROR;
1508 } 1509 }
1509 } else { 1510 } else {
1510 printk(KERN_ERR "%s: read timeout! ctrl=0x%04x intr=0x%04x\n", 1511 printk(KERN_ERR "%s: read timeout! ctrl 0x%04x "
1511 __func__, ctrl, interrupt); 1512 "intr 0x%04x addr1 %#x addr8 %#x\n",
1513 __func__, ctrl, interrupt, addr1, addr8);
1512 return ONENAND_BBT_READ_FATAL_ERROR; 1514 return ONENAND_BBT_READ_FATAL_ERROR;
1513 } 1515 }
1514 1516
1515 /* Initial bad block case: 0x2400 or 0x0400 */ 1517 /* Initial bad block case: 0x2400 or 0x0400 */
1516 if (ctrl & ONENAND_CTRL_ERROR) { 1518 if (ctrl & ONENAND_CTRL_ERROR) {
1517 printk(KERN_DEBUG "%s: controller error = 0x%04x\n", 1519 printk(KERN_DEBUG "%s: ctrl 0x%04x intr 0x%04x addr1 %#x "
1518 __func__, ctrl); 1520 "addr8 %#x\n", __func__, ctrl, interrupt, addr1, addr8);
1519 return ONENAND_BBT_READ_ERROR; 1521 return ONENAND_BBT_READ_ERROR;
1520 } 1522 }
1521 1523
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index 905209bf9465..fc2c16a0fd1c 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -101,8 +101,8 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
101 if (ret || check_short_pattern(&buf[j * scanlen], 101 if (ret || check_short_pattern(&buf[j * scanlen],
102 scanlen, this->writesize, bd)) { 102 scanlen, this->writesize, bd)) {
103 bbm->bbt[i >> 3] |= 0x03 << (i & 0x6); 103 bbm->bbt[i >> 3] |= 0x03 << (i & 0x6);
104 printk(KERN_WARNING "Bad eraseblock %d at 0x%08x\n", 104 printk(KERN_INFO "OneNAND eraseblock %d is an "
105 i >> 1, (unsigned int) from); 105 "initial bad block\n", i >> 1);
106 mtd->ecc_stats.badblocks++; 106 mtd->ecc_stats.badblocks++;
107 break; 107 break;
108 } 108 }