Commit d686e660 authored by David Woodhouse's avatar David Woodhouse

MTD NOR chip drivers: use msleep()

Description: Use msleep() instead of schedule_timeout()
to guarantee the task delays as expected.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 947668b2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Author: Jonas Holmberg <jonas.holmberg@axis.com> * Author: Jonas Holmberg <jonas.holmberg@axis.com>
* *
* $Id: amd_flash.c,v 1.25 2004/08/09 13:19:43 dwmw2 Exp $ * $Id: amd_flash.c,v 1.26 2004/11/20 12:49:04 dwmw2 Exp $
* *
* Copyright (c) 2001 Axis Communications AB * Copyright (c) 2001 Axis Communications AB
* *
...@@ -1122,7 +1122,7 @@ static inline int erase_one_block(struct map_info *map, struct flchip *chip, ...@@ -1122,7 +1122,7 @@ static inline int erase_one_block(struct map_info *map, struct flchip *chip,
timeo = jiffies + (HZ * 20); timeo = jiffies + (HZ * 20);
spin_unlock_bh(chip->mutex); spin_unlock_bh(chip->mutex);
schedule_timeout(HZ); msleep(1000);
spin_lock_bh(chip->mutex); spin_lock_bh(chip->mutex);
while (flash_is_busy(map, adr, private->interleave)) { while (flash_is_busy(map, adr, private->interleave)) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: cfi_cmdset_0002.c,v 1.111 2004/11/16 18:29:00 dwmw2 Exp $ * $Id: cfi_cmdset_0002.c,v 1.112 2004/11/20 12:49:04 dwmw2 Exp $
* *
*/ */
...@@ -1173,8 +1173,7 @@ static inline int do_erase_chip(struct map_info *map, struct flchip *chip) ...@@ -1173,8 +1173,7 @@ static inline int do_erase_chip(struct map_info *map, struct flchip *chip)
chip->in_progress_block_addr = adr; chip->in_progress_block_addr = adr;
cfi_spin_unlock(chip->mutex); cfi_spin_unlock(chip->mutex);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(chip->erase_time/2);
schedule_timeout((chip->erase_time*HZ)/(2*1000));
cfi_spin_lock(chip->mutex); cfi_spin_lock(chip->mutex);
timeo = jiffies + (HZ*20); timeo = jiffies + (HZ*20);
...@@ -1259,8 +1258,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u ...@@ -1259,8 +1258,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
chip->in_progress_block_addr = adr; chip->in_progress_block_addr = adr;
cfi_spin_unlock(chip->mutex); cfi_spin_unlock(chip->mutex);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(chip->erase_time/2);
schedule_timeout((chip->erase_time*HZ)/(2*1000));
cfi_spin_lock(chip->mutex); cfi_spin_lock(chip->mutex);
timeo = jiffies + (HZ*20); timeo = jiffies + (HZ*20);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* (C) 2000 Red Hat. GPL'd * (C) 2000 Red Hat. GPL'd
* *
* $Id: cfi_cmdset_0020.c,v 1.16 2004/11/16 18:29:00 dwmw2 Exp $ * $Id: cfi_cmdset_0020.c,v 1.17 2004/11/20 12:49:04 dwmw2 Exp $
* *
* 10/10/2000 Nicolas Pitre <nico@cam.org> * 10/10/2000 Nicolas Pitre <nico@cam.org>
* - completely revamped method functions so they are aware and * - completely revamped method functions so they are aware and
...@@ -788,7 +788,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u ...@@ -788,7 +788,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
chip->state = FL_ERASING; chip->state = FL_ERASING;
spin_unlock_bh(chip->mutex); spin_unlock_bh(chip->mutex);
schedule_timeout(HZ); msleep(1000);
spin_lock_bh(chip->mutex); spin_lock_bh(chip->mutex);
/* FIXME. Use a timer to check this, and return immediately. */ /* FIXME. Use a timer to check this, and return immediately. */
...@@ -1087,7 +1087,7 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un ...@@ -1087,7 +1087,7 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
chip->state = FL_LOCKING; chip->state = FL_LOCKING;
spin_unlock_bh(chip->mutex); spin_unlock_bh(chip->mutex);
schedule_timeout(HZ); msleep(1000);
spin_lock_bh(chip->mutex); spin_lock_bh(chip->mutex);
/* FIXME. Use a timer to check this, and return immediately. */ /* FIXME. Use a timer to check this, and return immediately. */
...@@ -1236,7 +1236,7 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip, ...@@ -1236,7 +1236,7 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
chip->state = FL_UNLOCKING; chip->state = FL_UNLOCKING;
spin_unlock_bh(chip->mutex); spin_unlock_bh(chip->mutex);
schedule_timeout(HZ); msleep(1000);
spin_lock_bh(chip->mutex); spin_lock_bh(chip->mutex);
/* FIXME. Use a timer to check this, and return immediately. */ /* FIXME. Use a timer to check this, and return immediately. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment