aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/floppy.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2012-07-02 20:27:04 -0400
committerJiri Kosina <jkosina@suse.cz>2012-07-04 08:01:40 -0400
commit0cc15d03bcccdf95e2bd82e094e6064e61b54207 (patch)
treef6ec256f60f185089e306096a73fbf12b5b8788e /drivers/block/floppy.c
parenta70f35af4e49f87ba4b6c4b30220fbb66cd74af6 (diff)
floppy: Run floppy initialization asynchronous
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. [jkosina@suse.cz: fix modular build] Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r--drivers/block/floppy.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index cce7df367b79..1347ba8b8377 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -191,6 +191,7 @@ static int print_unex = 1;
191#include <linux/mutex.h> 191#include <linux/mutex.h>
192#include <linux/io.h> 192#include <linux/io.h>
193#include <linux/uaccess.h> 193#include <linux/uaccess.h>
194#include <linux/async.h>
194 195
195/* 196/*
196 * PS/2 floppies have much slower step rates than regular floppies. 197 * 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)
4122 return get_disk(disks[drive]); 4123 return get_disk(disks[drive]);
4123} 4124}
4124 4125
4125static int __init floppy_init(void) 4126static int __init do_floppy_init(void)
4126{ 4127{
4127 int i, unit, drive; 4128 int i, unit, drive;
4128 int err, dr; 4129 int err, dr;
@@ -4337,6 +4338,24 @@ out_put_disk:
4337 return err; 4338 return err;
4338} 4339}
4339 4340
4341#ifndef MODULE
4342static __init void floppy_async_init(void *data, async_cookie_t cookie)
4343{
4344 do_floppy_init();
4345}
4346#endif
4347
4348static int __init floppy_init(void)
4349{
4350#ifdef MODULE
4351 return do_floppy_init();
4352#else
4353 /* Don't hold up the bootup by the floppy initialization */
4354 async_schedule(floppy_async_init, NULL);
4355 return 0;
4356#endif
4357}
4358
4340static const struct io_region { 4359static const struct io_region {
4341 int offset; 4360 int offset;
4342 int size; 4361 int size;