public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch 2.6.16-git] mtd_dataflash, fix block vs page erase
@ 2006-02-16  6:30 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2006-02-16  6:30 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 60 bytes --]

The "<=" should be ">=", but it wouldn't matter with JFFS2.

[-- Attachment #2: data-0209.patch --]
[-- Type: text/x-diff, Size: 827 bytes --]

Fix a bug in the block-erase optimization for Dataflash; it was using
block erase even for smaller segments that need page erase.

That wouldn't matter for JFFS2, which never erases less than one block
(sometimes several blocks), but for other callers it might.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>


--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -178,7 +178,7 @@ static int dataflash_erase(struct mtd_in
 		 * we're at a block boundary and need to erase the whole block.
 		 */
 		pageaddr = instr->addr / priv->page_size;
-		do_block = (pageaddr & 0x7) == 0 && instr->len <= blocksize;
+		do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize;
 		pageaddr = pageaddr << priv->page_offset;
 
 		command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-16  6:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16  6:30 [patch 2.6.16-git] mtd_dataflash, fix block vs page erase David Brownell

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