Commit f8e30e44 authored by Dmitry Adamushko's avatar Dmitry Adamushko Committed by Linus Torvalds

mtd/chips: add missing set_current_state() to cfi_{amdstd,staa}_sync()

cfi_amdstd_sync() and cfi_staa_sync() call schedule() without changing task's
state appropriately.

In case of e.g.  chip->state == FL_ERASING, cfi_*_sync() will be busy-looping
either redundantly for a fixed interval of time (for SCHED_NORMAL tasks) or
possibly endlessly (for RT tasks and UP).
Signed-off-by: default avatarDmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b9ad8985
...@@ -1763,6 +1763,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd) ...@@ -1763,6 +1763,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
default: default:
/* Not an idle state */ /* Not an idle state */
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait); add_wait_queue(&chip->wq, &wait);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
......
...@@ -1015,6 +1015,7 @@ static void cfi_staa_sync (struct mtd_info *mtd) ...@@ -1015,6 +1015,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
default: default:
/* Not an idle state */ /* Not an idle state */
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait); add_wait_queue(&chip->wq, &wait);
spin_unlock_bh(chip->mutex); spin_unlock_bh(chip->mutex);
......
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