--- zzzz-none-000/linux-2.6.32.61/drivers/mtd/nand/nand_base.c 2013-06-10 09:43:48.000000000 +0000 +++ ar10-7272-687/linux-2.6.32.61/drivers/mtd/nand/nand_base.c 2013-10-17 11:57:07.000000000 +0000 @@ -360,7 +360,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) { struct nand_chip *chip = mtd->priv; - uint8_t buf[2] = { 0, 0 }; + uint8_t buf[2] = { 2, 2 }; // hbl: 2 == user bad marked (kernel, urlader nimmt die 1) int block, ret; /* Get block number */ @@ -1787,11 +1787,11 @@ } #ifdef CONFIG_MTD_NAND_VERIFY_WRITE - /* Send command to read back the data */ - chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); + /* Send command to read back the data */ + chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); - if (chip->verify_buf(mtd, buf, mtd->writesize)) - return -EIO; + if (chip->verify_buf(mtd, buf, mtd->writesize)) + return -EIO; #endif return 0; } @@ -2237,13 +2237,15 @@ /* * heck if we have a bad block, we do not erase bad blocks ! */ - if (nand_block_checkbad(mtd, ((loff_t) page) << - chip->page_shift, 0, allowbbt)) { - printk(KERN_WARNING "%s: attempt to erase a bad block " - "at page 0x%08x\n", __func__, page); - instr->state = MTD_ERASE_FAILED; - goto erase_exit; - } + if (instr->priv != 1) { /*--- 1 signals force to mtd->erase ---*/ + if (nand_block_checkbad(mtd, ((loff_t) page) << + chip->page_shift, 0, allowbbt)) { + printk(KERN_WARNING "%s: attempt to erase a bad block " + "at page 0x%08x\n", __func__, page); + instr->state = MTD_ERASE_FAILED; + goto erase_exit; + } + } /* * Invalidate the page cache, if we erase the block which