···318318 ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);319319320320 if (ctrl & ONENAND_CTRL_ERROR) {321321- /* It maybe occur at initial bad block */322321 DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: controller error = 0x%04x\n", ctrl);323323- /* Clear other interrupt bits for preventing ECC error */324324- interrupt &= ONENAND_INT_MASTER;325325- }326326-327327- if (ctrl & ONENAND_CTRL_LOCK) {328328- DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error = 0x%04x\n", ctrl);329329- return -EACCES;322322+ if (ctrl & ONENAND_CTRL_LOCK)323323+ DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error.\n");324324+ return ctrl;330325 }331326332327 if (interrupt & ONENAND_INT_READ) {···745750746751 ret = this->wait(mtd, FL_READING);747752 /* First copy data and check return value for ECC handling */748748- onenand_update_bufferram(mtd, from, 1);753753+ onenand_update_bufferram(mtd, from, !ret);749754 }750755751756 this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);752752-753753- read += thislen;754754-755755- if (read == len)756756- break;757757758758 if (ret) {759759 DEBUG(MTD_DEBUG_LEVEL0, "onenand_read: read failed = %d\n", ret);760760 goto out;761761 }762762+763763+ read += thislen;764764+765765+ if (read == len)766766+ break;762767763768 from += thislen;764769 buf += thislen;···827832828833 this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);829834835835+ if (ret) {836836+ DEBUG(MTD_DEBUG_LEVEL0, "onenand_read_oob: read failed = 0x%x\n", ret);837837+ goto out;838838+ }839839+830840 read += thislen;831841832842 if (read == len)833843 break;834834-835835- if (ret) {836836- DEBUG(MTD_DEBUG_LEVEL0, "onenand_read_oob: read failed = %d\n", ret);837837- goto out;838838- }839844840845 buf += thislen;841846···11941199 ret = this->wait(mtd, FL_ERASING);11951200 /* Check, if it is write protected */11961201 if (ret) {11971197- if (ret == -EPERM)11981198- DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Device is write protected!!!\n");11991199- else12001200- DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Failed erase, block %d\n", (unsigned) (addr >> this->erase_shift));12021202+ DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Failed erase, block %d\n", (unsigned) (addr >> this->erase_shift));12011203 instr->state = MTD_ERASE_FAILED;12021204 instr->fail_addr = addr;12031205 goto erase_exit;
+2-1
drivers/mtd/onenand/onenand_bbt.c
···9393 ret = onenand_do_read_oob(mtd, from + j * mtd->writesize + bd->offs,9494 readlen, &retlen, &buf[0]);95959696- if (ret)9696+ /* If it is a initial bad block, just ignore it */9797+ if (ret && !(ret & ONENAND_CTRL_LOAD))9798 return ret;989999100 if (check_short_pattern(&buf[j * scanlen], scanlen, mtd->writesize, bd)) {