|
@@ -635,14 +635,14 @@ int nand_write_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length,
|
|
|
}
|
|
|
|
|
|
while (left_to_write > 0) {
|
|
|
+ loff_t block_start = offset & ~(loff_t)(mtd->erasesize - 1);
|
|
|
size_t block_offset = offset & (mtd->erasesize - 1);
|
|
|
size_t write_size, truncated_write_size;
|
|
|
|
|
|
WATCHDOG_RESET();
|
|
|
|
|
|
- if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) {
|
|
|
- printf("Skip bad block 0x%08llx\n",
|
|
|
- offset & ~(mtd->erasesize - 1));
|
|
|
+ if (nand_block_isbad(mtd, block_start)) {
|
|
|
+ printf("Skip bad block 0x%08llx\n", block_start);
|
|
|
offset += mtd->erasesize - block_offset;
|
|
|
continue;
|
|
|
}
|