[PATCH 2/3]async serio shutdown

From: Shaohua Li
Date: Mon Jan 12 2009 - 01:57:19 EST


serio shutdown is quite slow. It sometimes will take 0.2s for each port.

Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
---
drivers/input/serio/serio.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux/drivers/input/serio/serio.c
===================================================================
--- linux.orig/drivers/input/serio/serio.c 2009-01-12 14:38:06.000000000 +0800
+++ linux/drivers/input/serio/serio.c 2009-01-12 14:41:24.000000000 +0800
@@ -36,6 +36,7 @@
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
+#include <linux/async.h>

MODULE_AUTHOR("Vojtech Pavlik <vojtech@xxxxxx>");
MODULE_DESCRIPTION("Serio abstraction core");
@@ -798,11 +799,17 @@ static void serio_cleanup(struct serio *
mutex_unlock(&serio->drv_mutex);
}

+static void serio_async_shutdown(void *data, async_cookie_t cookie)
+{
+ struct serio *serio = data;
+ serio_cleanup(serio);
+}
+
static void serio_shutdown(struct device *dev)
{
struct serio *serio = to_serio_port(dev);

- serio_cleanup(serio);
+ async_schedule(serio_async_shutdown, serio);
}

static void serio_attach_driver(struct serio_driver *drv)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/