linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: dtor@mail.ru
Cc: linux-input@vger.kernel.org, akpm@linux-foundation.org,
	shaohua.li@intel.com, arjan@infradead.org
Subject: [patch 9/9] serios: async shutdown
Date: Tue, 12 May 2009 13:43:11 -0700	[thread overview]
Message-ID: <200905122102.n4CL2RUY006919@imap1.linux-foundation.org> (raw)

From: Shaohua Li <shaohua.li@intel.com>

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

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/input/serio/serio.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff -puN drivers/input/serio/serio.c~serios-async-shutdown drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c~serios-async-shutdown
+++ a/drivers/input/serio/serio.c
@@ -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@ucw.cz>");
 MODULE_DESCRIPTION("Serio abstraction core");
@@ -792,11 +793,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)
_

             reply	other threads:[~2009-05-12 21:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 20:43 akpm [this message]
2009-05-14  3:20 ` [patch 9/9] serios: async shutdown Dmitry Torokhov
2009-05-14  3:49   ` Andrew Morton

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=200905122102.n4CL2RUY006919@imap1.linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).