Skip to contentSkip to conversation

serios: async shutdown

PATCH In review [email protected] 2 participants 3 messages May 12, 2009 – May 14, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 9/9 serios: async shutdown

From: Shaohua Li <[email protected]>

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

Cc Arjan van de Ven <[email protected]>
Cc Dmitry Torokhov <[email protected]>

---

 drivers/input/serio/serio.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/input/serio/serio.c renamed from drivers/input/serio/serio.c~serios-async-shutdown +8 -1
diff -puN drivers/input/serio/serio.c~serios-async-shutdown 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 <[email protected]>");
 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)

_

maintainer
#1 lore raw

Hi,

Quoted 4 lines · On Tue, May 12, 2009 at 01:43:11PM -0700, [email protected] wrote:

From: Shaohua Li <[email protected]>

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

This depends on the other patch you sent to Greg, I think these should go together. But I am uncomfortable at the ide of blasting all ports on i8042 simultaneously during shutdown. I'd be more comfortable if we were taking serio_mutex in serio_cleanup() so only one port is being worked on at a time.

Quoted 41 lines
Cc Arjan van de Ven <[email protected]>
Cc Dmitry Torokhov <[email protected]>

---

 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

drivers/input/serio/serio.c renamed from drivers/input/serio/serio.c~serios-async-shutdown +8 -1
@@ -36,6 +36,7 @@
 #include <linux/kthread.h>
 #include <linux/mutex.h>
 #include <linux/freezer.h>
+#include <linux/async.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
 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)

_

Signature · 1 line
Dmitry
#2 lore raw
Quoted 7 lines · On Wed, 13 May 2009 20:20:56 -0700 Dmitry Torokhov <[email protected]>…
Quoted 4 lines · On Tue, May 12, 2009 at 01:43:11PM -0700, [email protected] wrote:

From: Shaohua Li <[email protected]>

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

This depends on the other patch you sent to Greg,

synchronize-device-shutdown.patch, I assume.

Quoted 5 lines

I think these should
go together. But I am uncomfortable at the ide of blasting all ports on i8042 simultaneously during shutdown. I'd be more comfortable if we were taking serio_mutex in serio_cleanup() so only one port is being worked on at a time.

OK, more thought is needed. I dropped the patches.