From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757143Ab2GCTgq (ORCPT ); Tue, 3 Jul 2012 15:36:46 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:53214 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980Ab2GCTgo (ORCPT ); Tue, 3 Jul 2012 15:36:44 -0400 Message-ID: <1341344200.2413.4.camel@nayuki.kepstin.ca> Subject: Re: long boot delays caused by 070ad7e7 floppy change From: Calvin Walton To: Linus Torvalds Cc: Andi Kleen , Jiri Kosina , linux-kernel@vger.kernel.org, shemminger@vyatta.com Date: Tue, 03 Jul 2012 15:36:40 -0400 In-Reply-To: References: <20120702224648.GA20361@tassilo.jf.intel.com> <1341323230.3292.10.camel@nayuki.kepstin.ca> <1341337257.2406.1.camel@nayuki.kepstin.ca> <20120703185808.GM11413@one.firstfloor.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2012-07-03 at 12:12 -0700, Linus Torvalds wrote: > What happens if you add a > > cancel_delayed_work(&fd_timeout); > > to before the queue_delayed_work() in __reschedule_timeout()? Does > that possibly make the delay really be 3 seconds? Yes, it does... [ 0.718571] floppy0: reschedule timeout lock fdc [ 1.650956] Refined TSC clocksource calibration: 2698.760 MHz. [ 1.651109] Switching to clocksource tsc [ 3.724664] floppy0: reschedule timeout do wakeup [ 3.724815] floppy0: no floppy controllers found diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index cce7df3..c8064e4 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -678,6 +678,8 @@ static void __reschedule_timeout(int drive, const char *message) } else delay = UDP->timeout; + cancel_delayed_work(&fd_timeout); + queue_delayed_work(floppy_wq, &fd_timeout, delay); if (UDP->flags & FD_DEBUG) DPRINT("reschedule timeout %s\n", message); Of course, a 3 second delay at this point in boot is still a fairly big bit of waiting, given how fast everything else is nowadays. -- Calvin Walton