aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-03 18:51:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-03 18:51:22 -0400
commitdab058fd5ff834cb3b9de1d930ce731a605eb0c6 (patch)
tree33963e3af2b40b925eda0baf29bd2fd2ccafca4f /drivers/block
parenta3da2c6913469ecb2224d891c45470b37b4d67f4 (diff)
floppy: cancel any pending fd_timeouts before adding a new one
In commit 070ad7e793dc ("floppy: convert to delayed work and single-thread wq") the 'fd_timeout' timer was converted to a delayed work. However, the "del_timer(&fd_timeout)" was lost in the process, and any previous pending timeouts would stay active when we then re-queued the timeout. This resulted in the floppy probe sequence having a (stale) 20s timeout rather than the intended 3s timeout, and thus made booting with the floppy driver (but no actual floppy controller) take much longer than it should. Of course, there's little reason for most people to compile the floppy driver into the kernel at all, which is why most people never noticed. Canceling the delayed work where we used to do the del_timer() fixes the issue, and makes the floppy probing use the proper new timeout instead. The three second timeout is still very wasteful, but better than the 20s one. Reported-and-tested-by: Andi Kleen <ak@linux.intel.com> Reported-and-tested-by: Calvin Walton <calvin.walton@kepstin.ca> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/floppy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index cce7df367b79..553f43a90953 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -671,6 +671,7 @@ static void __reschedule_timeout(int drive, const char *message)
671 671
672 if (drive == current_reqD) 672 if (drive == current_reqD)
673 drive = current_drive; 673 drive = current_drive;
674 __cancel_delayed_work(&fd_timeout);
674 675
675 if (drive < 0 || drive >= N_DRIVE) { 676 if (drive < 0 || drive >= N_DRIVE) {
676 delay = 20UL * HZ; 677 delay = 20UL * HZ;