diff options
author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2009-11-19 06:01:58 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-11-30 04:58:53 -0500 |
commit | 2695eab964efaa382168e0351705967bd9deb7ea (patch) | |
tree | 41c2711f7849f6a0be9ce388fad33fb4ddb62ffa | |
parent | c1317f7163d287805b8e12af12d04a2a6ead865c (diff) |
mtd: CFI cmdset_0002: enable erase-suspend-program
Erase-suspend for writing is required to avoid blocking applications
that wish to write some data (to a NOR block other than the one being
erased). Particularly, it solves some huge delays that an application
(which writes to a UBIFS) will experience if UBI attaches to empty NOR
flash. In this case the UBI background thread will erase a lot of blocks
and the application can be blocked for minutes because of the "MTD/CFI
chip lock".
This feature has been disabled for years. Maybe this was because the old
code turned it on for erase-suspend read-only chips also
(cfip->EraseSuspend & 0x1). This is wrong and corrected now.
This patch was tweaked by Norbert van Bolhuis.
Signed-off-by: Norbert van Bolhuis <nvbolhuis@aimvalley.nl>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 94bb61e19047..1d49e18adbf6 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -490,10 +490,6 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) | |||
490 | } | 490 | } |
491 | #endif | 491 | #endif |
492 | 492 | ||
493 | /* FIXME: erase-suspend-program is broken. See | ||
494 | http://lists.infradead.org/pipermail/linux-mtd/2003-December/009001.html */ | ||
495 | printk(KERN_NOTICE "cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.\n"); | ||
496 | |||
497 | __module_get(THIS_MODULE); | 493 | __module_get(THIS_MODULE); |
498 | return mtd; | 494 | return mtd; |
499 | 495 | ||
@@ -589,15 +585,9 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr | |||
589 | return 0; | 585 | return 0; |
590 | 586 | ||
591 | case FL_ERASING: | 587 | case FL_ERASING: |
592 | if (mode == FL_WRITING) /* FIXME: Erase-suspend-program appears broken. */ | 588 | if (!cfip || !(cfip->EraseSuspend & (0x1|0x2)) || |
593 | goto sleep; | 589 | !(mode == FL_READY || mode == FL_POINT || |
594 | 590 | (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) | |
595 | if (!( mode == FL_READY | ||
596 | || mode == FL_POINT | ||
597 | || !cfip | ||
598 | || (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)) | ||
599 | || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1) | ||
600 | ))) | ||
601 | goto sleep; | 591 | goto sleep; |
602 | 592 | ||
603 | /* We could check to see if we're trying to access the sector | 593 | /* We could check to see if we're trying to access the sector |