diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-02-26 12:01:41 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-03-13 14:56:38 -0600 |
commit | 7b8a3d22ba93682a542a445ef43d03f495cdf3d6 (patch) | |
tree | a4eb23f8700166ded319f7e7352ae527fdf234a7 /drivers/block/swim3.c | |
parent | 9c552e1ddd3658944787d75d90a42e1a2b74b7ea (diff) | |
download | op-kernel-dev-7b8a3d22ba93682a542a445ef43d03f495cdf3d6.zip op-kernel-dev-7b8a3d22ba93682a542a445ef43d03f495cdf3d6.tar.gz |
ataflop: fix sleep_on races
sleep_on() is inherently racy, and has been deprecated for a long time.
This fixes two instances in the atari floppy driver:
* fdc_wait/fdc_busy becomes an open-coded mutex. We cannot use the
regular mutex since it gets released in interrupt context. The
open-coded version using wait_event() and cmpxchg() is equivalent
to the existing code but does the checks atomically, and we can
now safely check the condition with irqs enabled.
* format_wait becomes a completion, which is the natural structure
here. The format ioctl waits for the background task to either
complete or abort.
This does not attempt to fix the preexisting bug of calling schedule
with local interrupts disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/swim3.c')
0 files changed, 0 insertions, 0 deletions