diff options
Diffstat (limited to 'target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch')
-rw-r--r-- | target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch b/target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch index 24b9344..f2fa367 100644 --- a/target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch +++ b/target/linux/generic/patches-3.6/401-partial_eraseblock_write.patch @@ -9,7 +9,7 @@ /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -252,13 +254,60 @@ static int part_erase(struct mtd_info *m +@@ -230,13 +232,60 @@ static int part_erase(struct mtd_info *m struct mtd_part *part = PART(mtd); int ret; @@ -70,21 +70,21 @@ return ret; } -@@ -266,7 +315,25 @@ void mtd_erase_callback(struct erase_inf +@@ -244,7 +293,25 @@ void mtd_erase_callback(struct erase_inf { - if (instr->mtd->erase == part_erase) { + if (instr->mtd->_erase == part_erase) { struct mtd_part *part = PART(instr->mtd); + size_t wrlen = 0; + if (instr->mtd->flags & MTD_ERASE_PARTIAL) { + if (instr->partial_start) { -+ part->master->write(part->master, ++ part->master->_write(part->master, + instr->addr, instr->erase_buf_ofs, + &wrlen, instr->erase_buf); + instr->addr += instr->erase_buf_ofs; + } else { + instr->len -= instr->erase_buf_ofs; -+ part->master->write(part->master, ++ part->master->_write(part->master, + instr->addr + instr->len, + instr->erase_buf_ofs, &wrlen, + instr->erase_buf + @@ -96,7 +96,7 @@ if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; instr->addr -= part->offset; -@@ -537,18 +604,24 @@ static struct mtd_part *allocate_partiti +@@ -504,18 +571,24 @@ static struct mtd_part *allocate_partiti if ((slave->mtd.flags & MTD_WRITEABLE) && mtd_mod_by_eb(slave->offset, &slave->mtd)) { /* Doesn't start on a boundary of major erase size */ @@ -129,7 +129,7 @@ + part->name); slave->mtd.ecclayout = master->ecclayout; - if (master->block_isbad) { + slave->mtd.ecc_strength = master->ecc_strength; --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -58,6 +58,10 @@ struct erase_info { |