Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84201
b: refs/heads/master
c: 6c24e41
h: refs/heads/master
i:
  84199: abba7d4
v: v3
  • Loading branch information
Alexander Belyakov authored and David Woodhouse committed Nov 26, 2007
1 parent e601980 commit cc32acf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f4d47d5d1060a93be83e33a167a53a7f8c08b20
refs/heads/master: 6c24e4161e80a5c03e9d969b5db73d8553846037
15 changes: 15 additions & 0 deletions trunk/drivers/mtd/chips/cfi_cmdset_0001.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode)
{
int ret;
DECLARE_WAITQUEUE(wait, current);

retry:
if (chip->priv && (mode == FL_WRITING || mode == FL_ERASING
Expand Down Expand Up @@ -851,6 +852,20 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
spin_unlock(contender->mutex);
}

/* Check if we already have suspended erase
* on this chip. Sleep. */
if (mode == FL_ERASING && shared->erasing
&& shared->erasing->oldstate == FL_ERASING) {
spin_unlock(&shared->lock);
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
spin_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
spin_lock(chip->mutex);
goto retry;
}

/* We now own it */
shared->writing = chip;
if (mode == FL_ERASING)
Expand Down

0 comments on commit cc32acf

Please sign in to comment.