|
@@ -816,9 +816,10 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
|
|
(mode == FL_WRITING && (cfip->EraseSuspend & 0x2))))
|
|
(mode == FL_WRITING && (cfip->EraseSuspend & 0x2))))
|
|
goto sleep;
|
|
goto sleep;
|
|
|
|
|
|
- /* We could check to see if we're trying to access the sector
|
|
|
|
- * that is currently being erased. However, no user will try
|
|
|
|
- * anything like that so we just wait for the timeout. */
|
|
|
|
|
|
+ /* Do not allow suspend iff read/write to EB address */
|
|
|
|
+ if ((adr & chip->in_progress_block_mask) ==
|
|
|
|
+ chip->in_progress_block_addr)
|
|
|
|
+ goto sleep;
|
|
|
|
|
|
/* Erase suspend */
|
|
/* Erase suspend */
|
|
/* It's harmless to issue the Erase-Suspend and Erase-Resume
|
|
/* It's harmless to issue the Erase-Suspend and Erase-Resume
|
|
@@ -2267,6 +2268,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
|
|
chip->state = FL_ERASING;
|
|
chip->state = FL_ERASING;
|
|
chip->erase_suspended = 0;
|
|
chip->erase_suspended = 0;
|
|
chip->in_progress_block_addr = adr;
|
|
chip->in_progress_block_addr = adr;
|
|
|
|
+ chip->in_progress_block_mask = ~(map->size - 1);
|
|
|
|
|
|
INVALIDATE_CACHE_UDELAY(map, chip,
|
|
INVALIDATE_CACHE_UDELAY(map, chip,
|
|
adr, map->size,
|
|
adr, map->size,
|
|
@@ -2356,6 +2358,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|
chip->state = FL_ERASING;
|
|
chip->state = FL_ERASING;
|
|
chip->erase_suspended = 0;
|
|
chip->erase_suspended = 0;
|
|
chip->in_progress_block_addr = adr;
|
|
chip->in_progress_block_addr = adr;
|
|
|
|
+ chip->in_progress_block_mask = ~(len - 1);
|
|
|
|
|
|
INVALIDATE_CACHE_UDELAY(map, chip,
|
|
INVALIDATE_CACHE_UDELAY(map, chip,
|
|
adr, len,
|
|
adr, len,
|