Skip to contentSkip to conversation

Input: speed up suspend/shutdown for PS/2 mice and keyboards

RFT Dmitry Torokhov 6 participants 13 messages Dec 21, 2009 – Dec 27, 2009

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

Hi,

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

Thanks!

Signature · 14 lines
Dmitry


Input: speed up suspend/shutdown for PS/2 mice and keyboards

Instead of doing full-blown reset while suspending or shutting down
the box use lighter form of reset that should take less time.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

 drivers/input/keyboard/atkbd.c     |    5 +++--
 drivers/input/mouse/psmouse-base.c |    5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/input/keyboard/atkbd.c +3 -2
index a357357..1f5e2ce 100644
@@ -134,7 +134,8 @@ static const unsigned short atkbd_unxlate_table[128] = {
 #define ATKBD_CMD_GETID		0x02f2
 #define ATKBD_CMD_SETREP	0x10f3
 #define ATKBD_CMD_ENABLE	0x00f4
-#define ATKBD_CMD_RESET_DIS	0x00f5
+#define ATKBD_CMD_RESET_DIS	0x00f5	/* Reset to defaults and disable */
+#define ATKBD_CMD_RESET_DEF	0x00f6	/* Reset to defaults */
 #define ATKBD_CMD_SETALL_MBR	0x00fa
 #define ATKBD_CMD_RESET_BAT	0x02ff
 #define ATKBD_CMD_RESEND	0x00fe
@@ -836,7 +837,7 @@ static void atkbd_cleanup(struct serio *serio)
 	struct atkbd *atkbd = serio_get_drvdata(serio);
 
 	atkbd_disable(atkbd);
-	ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT);
+	ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_DEF);
 }
 
 
drivers/input/mouse/psmouse-base.c +4 -1
index fd0bc09..401ac6b 100644
@@ -1137,7 +1137,10 @@ static void psmouse_cleanup(struct serio *serio)
 	if (psmouse->cleanup)
 		psmouse->cleanup(psmouse);
 
-	psmouse_reset(psmouse);
+/*
+ * Reset the mouse to defaults (bare PS/2 protocol).
+ */
+	ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
 
 /*
  * Some boxes, such as HP nx7400, get terribly confused if mouse
#1 lore raw
Quoted 6 lines · Dmitry Torokhov

Hi,

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

It works okay on my machine (Intel ICH4).

Alan Stern

#2 lore raw
In reply to Dmitry Torokhov
Quoted 6 lines · Dmitry Torokhov

Hi,

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

It works okay on my machine (Intel ICH4).

Alan Stern

#3 lore raw
Quoted 10 lines · Alan Stern
Quoted 6 lines · Dmitry Torokhov

Hi,

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

It works okay on my machine (Intel ICH4).

Likewise on my Toshiba Portege R500 (ICH7).

[Of course, it also works on my other test boxes, the Wind has ICH7 like the Toshiba, and the nx6325 has ATI SB400).

Rafael

#4 lore raw
In reply to Alan Stern
Quoted 10 lines · Alan Stern
Quoted 6 lines · Dmitry Torokhov

Hi,

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

It works okay on my machine (Intel ICH4).

Likewise on my Toshiba Portege R500 (ICH7).

[Of course, it also works on my other test boxes, the Wind has ICH7 like the Toshiba, and the nx6325 has ATI SB400).

Rafael

#5 lore raw
In reply to Dmitry Torokhov
Quoted 6 lines · Dmitry Torokhov

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

Seems to work on my ICH8 lapdog (a Fujitsu T2010), can't say it actually speeds the suspend/resume cycle up though.

Cheers

Signature · 2 lines
Alexander Clouter
.sigmonster says: Bus error -- driver executed.
#6 lore raw
Quoted 9 lines · Alexander Clouter
Quoted 6 lines · Dmitry Torokhov

I am asking everyone to give this patch a try. It is reported to speed up suspend process, however there is a risk that there are boxes out there that do require full reset and I would prefer to know that sooner than later.

Seems to work on my ICH8 lapdog (a Fujitsu T2010), can't say it actually speeds the suspend/resume cycle up though.

With 2.6.33-rc2, if you do

dmesg | grep "of devices"

that will give you total device suspend/resume times. By comparing the times with and without the patch you should be able to tell the difference (if any).

Rafael

#7 lore raw
In reply to Dmitry Torokhov

Works on my ThinkPad T43 (KBC emulated by the embedded controller firmware), although I don't think it made much difference in speed.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
#8 lore raw
In reply to Dmitry Torokhov

Works on my ThinkPad T43 (KBC emulated by the embedded controller firmware), although I don't think it made much difference in speed.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
author maintainer
#9 lore raw
Quoted 3 lines · Henrique de Moraes Holschuh

Works on my ThinkPad T43 (KBC emulated by the embedded controller firmware), although I don't think it made much difference in speed.

Thanks. The speedup should not be that noticeable (even worst hardware usually manages to do full reset in 0.5 sec), still 0.5 sec here and 0.5 sec there may add up.

Signature · 1 line
Dmitry
author maintainer
#10 lore raw
In reply to Henrique de Moraes Holschuh
Quoted 3 lines · Henrique de Moraes Holschuh

Works on my ThinkPad T43 (KBC emulated by the embedded controller firmware), although I don't think it made much difference in speed.

Thanks. The speedup should not be that noticeable (even worst hardware usually manages to do full reset in 0.5 sec), still 0.5 sec here and 0.5 sec there may add up.

Signature · 1 line
Dmitry
#11 lore raw
In reply to Dmitry Torokhov

Hi,

On an ATI SB600 (RS690), no problems either on mouse/kbd after a S2R cycle, on current git with this patch applied (verified).
And this with a rather problematic "new-fangled, designer (tm)" Logitech Wireless Keyboard M/N Y-RR54 , P/N 867512-0102 (plus mouse!), plugged into PS/2 connectors!

Thanks for your work!

Andreas Mohr

#12 lore raw
In reply to Dmitry Torokhov

Hi,

On an ATI SB600 (RS690), no problems either on mouse/kbd after a S2R cycle, on current git with this patch applied (verified).
And this with a rather problematic "new-fangled, designer (tm)" Logitech Wireless Keyboard M/N Y-RR54 , P/N 867512-0102 (plus mouse!), plugged into PS/2 connectors!

Thanks for your work!

Andreas Mohr