public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [BUG] mtd-utils: nandwrite: invalid erase after page write failure
@ 2011-08-11 15:30 Fryar, Jeff
  2011-08-11 15:39 ` Mike Frysinger
  2011-08-19 17:02 ` Artem Bityutskiy
  0 siblings, 2 replies; 8+ messages in thread
From: Fryar, Jeff @ 2011-08-11 15:30 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

mtd-utils nandwrite.c: After a page write failure, the calculation
of the block number to erase is incorrect.  The erase block size is 
being passed as the erase block number in the call to mtd_erase().

Jeff Fryar <jeff.fryar@hp.com>


--- mtd-utils-f1fe865/nandwrite.c.ORIG  2011-07-20 00:28:52.000000000 -0500
+++ mtd-utils-f1fe865/nandwrite.c       2011-08-11 09:19:12.000000000 -0500
@@ -659,7 +659,7 @@
                        fprintf(stderr, "Erasing failed write from %#08llx to %#08llx\n",
                                blockstart, blockstart + ebsize_aligned - 1);
                        for (i = blockstart; i < blockstart + ebsize_aligned; i += mtd.eb_size) {
-                               if (mtd_erase(mtd_desc, &mtd, fd, mtd.eb_size)) {
+                               if (mtd_erase(mtd_desc, &mtd, fd, (i/mtd.eb_size))) {
                                        int errno_tmp = errno;
                                        sys_errmsg("%s: MTD Erase failure", mtd_device);
                                        if (errno_tmp != EIO) {

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-19 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 15:30 [BUG] mtd-utils: nandwrite: invalid erase after page write failure Fryar, Jeff
2011-08-11 15:39 ` Mike Frysinger
2011-08-17  4:42   ` Fryar, Jeff
2011-08-19 17:08   ` Artem Bityutskiy
2011-08-19 17:02 ` Artem Bityutskiy
2011-08-19 17:22   ` Brian Norris
2011-08-19 18:13     ` Artem Bityutskiy
2011-08-19 18:47       ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox