Skip to content

Commit

Permalink
UBUNTU: SAUCE: isapnp_init: make isa PNP scans occur async
Browse files Browse the repository at this point in the history
The results of scanning for devices is to trigger udev events therefore
we can push this processing async.

This reduces kernel initialisation time (the time from bootloader to
starting userspace) by several 10ths of a second x86 32bit systems.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
  • Loading branch information
Andy Whitcroft authored and rtg-canonical committed Apr 5, 2013
1 parent ad7a8fe commit 0bb7c9b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/pnp/isapnp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <linux/init.h>
#include <linux/isapnp.h>
#include <linux/mutex.h>
#include <linux/async.h>
#include <asm/io.h>

#include "../base.h"
Expand Down Expand Up @@ -1001,7 +1002,7 @@ struct pnp_protocol isapnp_protocol = {
.disable = isapnp_disable_resources,
};

static int __init isapnp_init(void)
static int __init real_isapnp_init(void)
{
int cards;
struct pnp_card *card;
Expand Down Expand Up @@ -1095,6 +1096,16 @@ static int __init isapnp_init(void)
return 0;
}

static void __init async_isapnp_init(void *unused, async_cookie_t cookie)
{
(void)real_isapnp_init();
}

static int __init isapnp_init(void)
{
async_schedule(async_isapnp_init, NULL);
return 0;
}
device_initcall(isapnp_init);

/* format is: noisapnp */
Expand Down

0 comments on commit 0bb7c9b

Please sign in to comment.