]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/nand_util.c
Merge branch 'master' into next
[u-boot] / drivers / mtd / nand / nand_util.c
index 694ead68a16d90c9370b882e01b35b904254e226..7085d42cc1b92ebc7e4a543863c85867bd7cf245 100644 (file)
@@ -452,7 +452,7 @@ static size_t get_len_incl_bad (nand_info_t *nand, loff_t offset,
                len_incl_bad += block_len;
                offset       += block_len;
 
-               if ((offset + len_incl_bad) >= nand->size)
+               if (offset >= nand->size)
                        break;
        }
 
@@ -508,6 +508,8 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
                size_t block_offset = offset & (nand->erasesize - 1);
                size_t write_size;
 
+               WATCHDOG_RESET ();
+
                if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
                        printf ("Skip bad block 0x%08llx\n",
                                offset & ~(nand->erasesize - 1));
@@ -578,6 +580,8 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
                size_t block_offset = offset & (nand->erasesize - 1);
                size_t read_length;
 
+               WATCHDOG_RESET ();
+
                if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
                        printf ("Skipping bad block 0x%08llx\n",
                                offset & ~(nand->erasesize - 1));