From 7b8a3d22ba93682a542a445ef43d03f495cdf3d6 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 26 Feb 2014 12:01:41 +0100 Subject: [PATCH] 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 Cc: Jens Axboe Cc: Geert Uytterhoeven Cc: Michael Schmitz Signed-off-by: Jens Axboe --- Reading git-format-patch failed