From: Andi Kleen <andi@firstfloor.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] floppy: Run floppy initialization asynchronous
Date: Wed, 4 Jul 2012 14:31:31 +0200 [thread overview]
Message-ID: <20120704123131.GQ11413@one.firstfloor.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1207041402010.17304@pobox.suse.cz>
On Wed, Jul 04, 2012 at 02:03:07PM +0200, Jiri Kosina wrote:
> On Mon, 2 Jul 2012, Andi Kleen wrote:
>
> > From: Andi Kleen <ak@linux.intel.com>
> >
> > floppy_init is quite slow, 3s on my test system to determine
> > that there is no floppy. Run it asynchronous to the other
> > init calls to improve boot time.
> >
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > ---
> > drivers/block/floppy.c | 21 ++++++++++++++++++++-
> > 1 files changed, 20 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> > index cce7df3..8b5769b 100644
> > --- a/drivers/block/floppy.c
> > +++ b/drivers/block/floppy.c
> > @@ -191,6 +191,7 @@ static int print_unex = 1;
> > #include <linux/mutex.h>
> > #include <linux/io.h>
> > #include <linux/uaccess.h>
> > +#include <linux/async.h>
> >
> > /*
> > * PS/2 floppies have much slower step rates than regular floppies.
> > @@ -4122,7 +4123,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
> > return get_disk(disks[drive]);
> > }
> >
> > -static int __init floppy_init(void)
> > +static int __init do_floppy_init(void)
> > {
> > int i, unit, drive;
> > int err, dr;
> > @@ -4337,6 +4338,24 @@ out_put_disk:
> > return err;
> > }
> >
> > +#ifndef MODULE
> > +static __init void floppy_async_init(void *data, async_cookie_t cookie)
> > +{
> > + do_floppy_init();
> > +}
> > +#endif
> > +
> > +static int __init floppy_init(void)
> > +{
> > +#ifdef MODULE
> > + return do_floppy_init(void);
>
> This isn't really a valid C.
>
> I have fixed that and applied.
Thanks.
It would be also good to figure out how to move floppy_init
earlier in the init sequence. I think then you could hide more
of the 3s latency than just 1s.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
prev parent reply other threads:[~2012-07-04 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-03 0:27 [PATCH] floppy: Run floppy initialization asynchronous Andi Kleen
2012-07-04 12:03 ` Jiri Kosina
2012-07-04 12:31 ` Andi Kleen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120704123131.GQ11413@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox