diff options
author | Mark Brown <broonie@kernel.org> | 2018-05-21 19:17:37 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-05-21 19:17:37 +0100 |
commit | 08556e03ad36b2c6219aba90de88ccf58038e208 (patch) | |
tree | 1619cc5f466534b66b351985526e82da32b52028 /drivers/mtd/chips/cfi_cmdset_0002.c | |
parent | d1480f9b535fa3901b7f303959bc196b304472a9 (diff) | |
parent | 6ba89b52ba6916bc7a3d390d70951e992c0ca39e (diff) |
Merge tag 'v4.9.101' into linux-linaro-lsk-v4.9
This is the 4.9.101 stable release
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0002.c')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 9dca881bb378..107c05b3ddbb 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -812,9 +812,10 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) 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 */ /* It's harmless to issue the Erase-Suspend and Erase-Resume @@ -2263,6 +2264,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) chip->state = FL_ERASING; chip->erase_suspended = 0; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(map->size - 1); INVALIDATE_CACHE_UDELAY(map, chip, adr, map->size, @@ -2352,6 +2354,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, chip->state = FL_ERASING; chip->erase_suspended = 0; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(len - 1); INVALIDATE_CACHE_UDELAY(map, chip, adr, len, |