From: David Brownell <david-b@pacbell.net>
To: linux-mtd@lists.infradead.org
Subject: [patch 2.6.16-git] mtd_dataflash, fix block vs page erase
Date: Thu, 16 Feb 2006 06:30:41 -0000 [thread overview]
Message-ID: <200602152223.55786.david-b@pacbell.net> (raw)
[-- 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;
reply other threads:[~2006-02-16 6:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602152223.55786.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox