Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45697
b: refs/heads/master
c: f627248
h: refs/heads/master
i:
  45695: c91787f
v: v3
  • Loading branch information
Kyungmin Park authored and Artem Bityutskiy committed Jan 10, 2007
1 parent 73a262b commit cdaf6b5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: abb536e7ac8719243cfc4b40b39bf3eefd028f82
refs/heads/master: f62724873652ddb19edf7f92843e9456fe3be3ea
38 changes: 15 additions & 23 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,10 @@ static int onenand_wait(struct mtd_info *mtd, int state)
ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);

if (ctrl & ONENAND_CTRL_ERROR) {
/* It maybe occur at initial bad block */
DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: controller error = 0x%04x\n", ctrl);
/* Clear other interrupt bits for preventing ECC error */
interrupt &= ONENAND_INT_MASTER;
}

if (ctrl & ONENAND_CTRL_LOCK) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error = 0x%04x\n", ctrl);
return -EACCES;
if (ctrl & ONENAND_CTRL_LOCK)
DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error.\n");
return ctrl;
}

if (interrupt & ONENAND_INT_READ) {
Expand Down Expand Up @@ -750,21 +745,21 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,

ret = this->wait(mtd, FL_READING);
/* First copy data and check return value for ECC handling */
onenand_update_bufferram(mtd, from, 1);
onenand_update_bufferram(mtd, from, !ret);
}

this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);

read += thislen;

if (read == len)
break;

if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_read: read failed = %d\n", ret);
goto out;
}

read += thislen;

if (read == len)
break;

from += thislen;
buf += thislen;
}
Expand Down Expand Up @@ -832,16 +827,16 @@ int onenand_do_read_oob(struct mtd_info *mtd, loff_t from, size_t len,

this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);

if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_read_oob: read failed = 0x%x\n", ret);
goto out;
}

read += thislen;

if (read == len)
break;

if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_read_oob: read failed = %d\n", ret);
goto out;
}

buf += thislen;

/* Read more? */
Expand Down Expand Up @@ -1199,10 +1194,7 @@ static int onenand_erase(struct mtd_info *mtd, struct erase_info *instr)
ret = this->wait(mtd, FL_ERASING);
/* Check, if it is write protected */
if (ret) {
if (ret == -EPERM)
DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Device is write protected!!!\n");
else
DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Failed erase, block %d\n", (unsigned) (addr >> this->erase_shift));
DEBUG(MTD_DEBUG_LEVEL0, "onenand_erase: Failed erase, block %d\n", (unsigned) (addr >> this->erase_shift));
instr->state = MTD_ERASE_FAILED;
instr->fail_addr = addr;
goto erase_exit;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/mtd/onenand/onenand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
ret = onenand_do_read_oob(mtd, from + j * mtd->writesize + bd->offs,
readlen, &retlen, &buf[0]);

if (ret)
/* If it is a initial bad block, just ignore it */
if (ret && !(ret & ONENAND_CTRL_LOAD))
return ret;

if (check_short_pattern(&buf[j * scanlen], scanlen, mtd->writesize, bd)) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/jffs2/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c,
while (ref2) {
uint32_t totlen = ref_totlen(c, jeb, ref2);

if (ref_offset(ref2) < jeb->offset ||
ref_offset(ref2) > jeb->offset + c->sector_size) {
if (ref2->flash_offset < jeb->offset ||
ref2->flash_offset > jeb->offset + c->sector_size) {
JFFS2_ERROR("node_ref %#08x shouldn't be in block at %#08x.\n",
ref_offset(ref2), jeb->offset);
goto error;
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
for (i=0; i<c->nr_blocks; i++) {
struct jffs2_eraseblock *jeb = &c->blocks[i];

cond_resched();

/* reset summary info for next eraseblock scan */
jffs2_sum_reset_collected(s);

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/jffs2/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
for (i=0; i<je32_to_cpu(summary->sum_num); i++) {
dbg_summary("processing summary index %d\n", i);

cond_resched();

/* Make sure there's a spare ref for dirty space */
err = jffs2_prealloc_raw_node_refs(c, jeb, 2);
if (err)
Expand Down

0 comments on commit cdaf6b5

Please sign in to comment.