Skip to contentSkip to conversation

thinkpad x60s: middle button doesn't work after hibernate

DISCUSSION George Nychis 4 participants 8 messages Jul 20, 2006 – Jul 22, 2006

lore
Share & tools
lore
#0 lore raw

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

Anyone else experience this?

Thanks!
George

#1 lore raw
Quoted 8 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Quoted 7 lines

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

It sounds like psmouse resume method either not getting called or fails during resume from disk. Could you do:

echo 1 > /sys/modules/i8042/parameters/debug

before suspending and send me dmesg after resuming. Make sure you have big dmesg buffer.

Thanks!

Signature · 1 line
Dmitry
#2 lore raw
Quoted 20 lines · Dmitry Torokhov
Quoted 8 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Quoted 7 lines

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

It sounds like psmouse resume method either not getting called or fails during resume from disk. Could you do:

Quoted 7 lines

echo 1 > /sys/modules/i8042/parameters/debug

before suspending and send me dmesg after resuming. Make sure you have big dmesg buffer.

Thanks!

Here it is:
http://rafb.net/paste/results/hDJXzS85.html

thanks again :)

- George

#3 lore raw
Quoted 25 lines · George Nychis
Quoted 22 lines · Dmitry Torokhov
Quoted 8 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Quoted 7 lines

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

It sounds like psmouse resume method either not getting called or fails during resume from disk. Could you do:

echo 1 > /sys/modules/i8042/parameters/debug

Quoted 9 lines
Quoted 5 lines

before suspending and send me dmesg after resuming. Make sure you have big dmesg buffer.

Thanks!

Here it is:
http://rafb.net/paste/results/hDJXzS85.html

Hmm, resume routine gets called but the controller seems to be confused. It stopped reporting 1 in bit 3 of byte 0 in addition to not reporting middle button. Does it allow you pasting if you boot/suspend/resume with "psmouse.proto=exps" (assuming that psmouse is built in)? If so then trackpoint portion of psmouse driver needs to be looked at.

Signature · 1 line
Dmitry
#4 lore raw
In reply to George Nychis
Quoted 27 lines · George Nychis
Quoted 25 lines · Dmitry Torokhov
Quoted 8 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Quoted 7 lines

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

It sounds like psmouse resume method either not getting called or fails during resume from disk. Could you do:

echo 1 > /sys/modules/i8042/parameters/debug

before suspending and send me dmesg after resuming. Make sure you have big dmesg buffer.

Quoted 8 lines
Quoted 2 lines

Thanks!

Here it is:
http://rafb.net/paste/results/hDJXzS85.html

thanks again :)

Please try the patch below. If it still does not work try uncommenting call to psmouse_reset() in trackpoint_resume().

Signature · 107 lines
Dmitry

Input: trackpoint - activate protocol when resuming

Signed-off-by: Dmitry Torokhov <[email protected]>
---
 drivers/input/mouse/trackpoint.c |   54 ++++++++++++++++++++++++++-------------
 1 file changed, 36 insertions(+), 18 deletions(-)

Index: linux/drivers/input/mouse/trackpoint.c
===================================================================
--- linux.orig/drivers/input/mouse/trackpoint.c
+++ linux/drivers/input/mouse/trackpoint.c
@@ -183,21 +183,26 @@ static struct attribute_group trackpoint
 	.attrs = trackpoint_attrs,
 };
 
-static void trackpoint_disconnect(struct psmouse *psmouse)
+static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *firmware_id)
 {
-	sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
+	unsigned char param[2] = { 0 };
 
-	kfree(psmouse->private);
-	psmouse->private = NULL;
+	if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
+		return -1;
+
+	if (param[0] != TP_MAGIC_IDENT)
+		return -1;
+
+	if (firmware_id)
+		*firmware_id = param[1];
+
+	return 0;
 }
 
 static int trackpoint_sync(struct psmouse *psmouse)
 {
-	unsigned char toggle;
 	struct trackpoint_data *tp = psmouse->private;
-
-	if (!tp)
-		return -1;
+	unsigned char toggle;
 
 	/* Disable features that may make device unusable with this driver */
 	trackpoint_read(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, &toggle);
@@ -263,27 +268,40 @@ static void trackpoint_defaults(struct t
 	tp->ext_dev = TP_DEF_EXT_DEV;
 }
 
+static void trackpoint_disconnect(struct psmouse *psmouse)
+{
+	sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
+
+	kfree(psmouse->private);
+	psmouse->private = NULL;
+}
+
+static int trackpoint_reconnect(struct psmouse *psmouse)
+{
+	/* psmouse_reset(psmouse); */
+
+	if (trackpoint_start_protocol(psmouse, NULL))
+		return -1;
+
+	if (trackpoint_sync(psmouse))
+		return -1;
+
+	return 0;
+}
+
 int trackpoint_detect(struct psmouse *psmouse, int set_properties)
 {
 	struct trackpoint_data *priv;
 	struct ps2dev *ps2dev = &psmouse->ps2dev;
 	unsigned char firmware_id;
 	unsigned char button_info;
-	unsigned char param[2];
-
-	param[0] = param[1] = 0;
 
-	if (ps2_command(ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
-		return -1;
-
-	if (param[0] != TP_MAGIC_IDENT)
+	if (trackpoint_start_protocol(psmouse, &firmware_id))
 		return -1;
 
 	if (!set_properties)
 		return 0;
 
-	firmware_id = param[1];
-
 	if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
 		printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n");
 		button_info = 0;
@@ -296,7 +314,7 @@ int trackpoint_detect(struct psmouse *ps
 	psmouse->vendor = "IBM";
 	psmouse->name = "TrackPoint";
 
-	psmouse->reconnect = trackpoint_sync;
+	psmouse->reconnect = trackpoint_reconnect;
 	psmouse->disconnect = trackpoint_disconnect;
 
 	trackpoint_defaults(priv);
#5 lore raw
Quoted 28 lines · Dmitry Torokhov
Quoted 27 lines · George Nychis
Quoted 26 lines · Dmitry Torokhov
Quoted 8 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Quoted 7 lines

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

It sounds like psmouse resume method either not getting called or fails during resume from disk. Could you do:

echo 1 > /sys/modules/i8042/parameters/debug

before suspending and send me dmesg after resuming. Make sure you have big dmesg buffer.

Thanks!

Quoted 9 lines
Quoted 5 lines

Here it is:
http://rafb.net/paste/results/hDJXzS85.html

thanks again :)

Please try the patch below. If it still does not work try uncommenting call to psmouse_reset() in trackpoint_resume().

The unmodified patch worked like a charm, thanks so much for your time. work, and help Dmitry

- George

#6 lore raw
Quoted 4 lines · George Nychis

The unmodified patch worked like a charm, thanks so much for your time. work, and help Dmitry

Thank you for testing, I will queue it for the mainline.

Signature · 1 line
Dmitry
#7 lore raw
In reply to George Nychis
Quoted 5 lines · George Nychis

Hey guys,

I recently got the suspend to disk working and suspend to memory working thanks to many of you. Whenever I suspend to disk and resume, the middle mouse button on my thinkpad x60s no longer works for scrolling or

I observed the same on my T23.

Quoted 6 lines

for pasting. I either have to reboot, or suspend to memory and resume.
Therefore:

Initial Boot: working
Suspend to disk -> resume: not working
Suspend to memory -> resume: working

Thanks, that really works. I never tried to suspend to RAM after hibernation.

Quoted 3 lines

To fix it for now, i simply suspend to memory and resume after resuming a suspend to disk.

Unfortunately, I need a framebuffer console for the suspend2 progress display (text mode progress display didn't work), and savagefb has issues with hibernation, and vesafb is garbled after suspend to RAM.

Quoted 2 lines

Anyone else experience this?

Me.

Regards,
Tino